Switch to using the cached template loader.

The cached template loader will cache the path to a template, given a
template name. Unlike the standard loaders, which will search every
location every time, this will only search the location once per thread.

This is not a memcached-based solution, but rather local memory, so
every thread will start with a fresh cache.

In my tests, this sped up the dashboard and review request pages by
~100-120ms, after the first load.
Move opcodes_with_metadata into a DiffOpcodeGenerator class.

This new class performs all the same functions as the original
functions. Some of the code has been moved out into helper functions
for organization issues, but the logic hasn't changed.

This is part of an effort to clean up the diff viewer code and make it
more extensible.
Create a base Differ class and move some centralized stuff into it.

The two differs now inherit from Differ. This centralizes the
"interesting line" registration, and even the interesting line header
registration.

The filetype header maps have been moved into filetypes.py.

A tiny optimization was made, which was to check the diff compat version
1 (Myers differ) first, and not second. It won't make a huge difference,
but it's silly we didn't do that before.
Move chunk generation out of diffutils and into DiffChunkGenerator.

This class handles all the responsibilities of diff chunk generation.
It's basically the same code as before, but some things were able to be
cleaned up. For example, all the nested functions are gone, and instead
are just methods of the class. Functions can access self.<whatever>
instead of variables that happen to be in scope or variables. The yields
don't have to pass chunk_index and then increment it themselves.

This drastically shortens what's in diffutils.py. It also reduces how
much populate_diff_chunks now has to do.