Fixing stylesheet caching once and for all hopefully. Changed some ordering, simplified the monstrous if statement and fixed issues with paths.
Merge pull request #856 from euantorano/featurefix-776

Fixing stylesheet caching once and for all hopefully. Changed some order...