Started work on cacheing all layers, as it doesn't seem to use a lot of memory.
More work on cacheing everything.