make run{} return exit code
move event loop to queue module
poll can be nonblocking
brush script API a bit