Add template loading with cache