Added autoload and bugfix

Use $_SERVER['SERVER_NAME'] instead of $_SERVER['HTTP_HOST'] which can
contains ":", and make it impossible to create directory with that name