Enabling html5 mode

Enabled html5 mode the url redirecting on the server. Also some code cleaning snuck in.