Fix cache bloat

This addresses #576.

I didn't use tar files because the `tarfile` API is crap and not useable for our purpose. Instead I wrote my own file format.

This does not include any measures to prevent small matrices from being cached.

Python 3 tests seem to fail on Travis ... will fix those as soon as I fixed my local tox which is giving me invocation errors right now.