Make Magento usable on uncommon ports

The secure/unsecure port can be given for apache configuration, but Magento is initialized with just the hostname on the default ports. This pull request fixes this issue by using the standard library to generate URLs with the right ports while installing.