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

...ing, simplified the monstrous if statement and fixed issues with paths.