partly working without HOSTINSITE_HOST
lowercase tenant if adding to hostname
adjust algorithm for updating tenant in construct_url
Merge remote-tracking branch 'upstream/master'