Remove global should_exit and fix tests
Merge pull request #286 from m0sth8/remove_global_should_exit

Remove global should_exit and fix tests