Reduce server hits with JS history API

This patch aims to speed up page loads by removing the extra hit required by a 301 redirect.

The patch loads the requested page/post on the shortlink rather than using a 301 redirect. The JavaScript ```history.replaceState``` function is used to display the canonical URL to the visitor.

Individual results may vary but on my server it looks like it will save around 500ms.