Remove hardcoded URLs

Sorry for some of the short commit messages, I can clean this if required.

I have removed most of the hard coded URLs in the app so this will now work under a subdirectory on a virtual host if required.

Please let me know if you have any changes you would like me to make.

Thanks again.