Change nosetests to restart workers to save memory.
Add helper function to kill zombie octave sessions.
Refactoring and allow pty to be turned off.