Speed tweaks: implemented cached loader and corrected handling of user context in templates