Fixed terminal breaking and improved BSD support
While BSD is still not supported, we now try to be clever and use gsed
when sed fails. This version also improves error reporting a little bit.
Terminal breaking after using desed is fixed as well. As long as the code doesn't panic, you should find you terminal in the same state you left it.