Cache loaded Templates and move style tags into header