Update Unit2-HW1 to use Jinja2 and BaseHandler

Refactor of old solution. This is also functionally different to the
original solution: It fixes escaping correctly by using the inbuilt
jinja2 autoescaping.

The BaseHandler class is for convenience, saving monotonous invocations
of self.response.out.write.