Initial import of assembly cache.

This is an essentially unmodified import of George Boutsioukis' code.
delint
Clean up some logic
Replace obsolete debug function
Attempt to move the cache hook

Since assemble now returns Firedrake objects, we need to cache the
thunk, not the assemble. This doesn't work yet.
Fecking lint