Expose the "main thread" to c++

Also, implement a quick event loop for c++ code
Merge pull request #9 from skabbes/feature/event_loop

Expose the "main thread" to c++