Optimization cache by @yaoli - copy

Test copy without ipdb import. Used to run clean tests on Travis.
I still really don't like the "dump a big dict in a pickle" approach here.