support indented multi-line input

remove only one blank instead of ruining all indentation
support reattaching to jack buffered backend

previously the backend exited immediately on every attempt to
reattach the engine.