Get hostname in a cross-browser compatible way

Internet Explorer looses A.hostname property when href is set
dynamically with .setAttribute('href', '/whatever'). This is a problem
with client side templating engines like knockout.js. E.g. this link
created with templating would not work correctly in sammy.js, as it does
not have hostname.
<a data-bind="text: text, attr: { href: url}"></a>

The issues is fixed by checking hostname, and if it is missing, create a
new link and query the hostname from that link.
Fixed intendation, created test
Merge pull request #184 from rikkert/master

Fix AMD issues.
add amd issue fix to history
fix hostname issue in IE; fixes #183
Add support for Handlebars with proper AMD implementation.

This still works without AMD and for Handlebars 1.0.0 final which
has no support for AMD.