Template error context

When there is a template rendering error, this will help track down the problem by printing the template line with the error and 5 lines above and below the error.  After adding this patch I was able to track down a rendering problem instantly.

Please review and let me know.

Thanks!