Added workaround when hosting on the subdirectory of the server

1. I made a few workarounds to make the code works when it is not hosted on the root of a server.
2. To be more specific, I changed the absolute path into relative path in several files. 
3. The editor stripped off the padding space. I have nothing to do with that.