Added template context processor & middleware class