ported some more code from java version, and some intended template
SiteHoster refactored for Thread, to finesse later