Rename compile_loop to command_loop

This will later become a more general function
Some basic graceful shutdown of the escript subprocess