Cleanup of comments and code around sleeping.
Misc small cleanup.
Moved out main loop into run function.
Moved out socket init into own function.
Removed unnecessary assert as it is already in wrapper class.
Merge pull request #51 from murrekatt/main_cleanup

Even more main cleanup