make subdomain generation and redirection work with non-default ports

Hey,

I substituted HTTP_HOST with SERVER_NAME where used because the former can be manipulated by the client
it could be cleaned up more to minimise code duplication, I wanted to get it to work first and I have to delve a little deeper into CIs structure to do that. 
but we could probably do more with the the subdomain helper in the survey model?