add callback for on_loop_stop
added pid in toplevel run function to remove duplicate call to os.getpid(), removed extra call to on_loop_stop. would be great to pass in return type from workloop somehow...
Added comment and exitcode