Some refactoring, will make CDN easier to add if any non-dynamic files are stored away from root folder