Changed to use Kohana environment variable instead of a server environment variable that may not be defined.
Added logic to set a default sub_domain value of 'www' if no domain is present.
Merge pull request #1 from solocommand/master

Support for unset Kohana $environment, default sub_domain