Add some common code for handling GitHub fetch and template rendering errors.

Not all handlers are converted yet.

Inspired by http://blog.golang.org/error-handling-and-go, but also (ab)uses the
error mechanism to handle redirects.