Fix subdomain, add test, space and comment fix

Cleaning things when learning the code. 
Or try it here:
http://play.golang.org/p/0kzYUhMznv