Major cleanup of hlib - threading/server refactored
Lots of changes...