Set cache header for everything served from resources folder.
A bit of source reformatting
A bit of refactoring.