porting over model code
moved posixthread and locator to proper place