Don't cache multiply(), at least in some code paths.
Split cache_dict by function.

I'm not completely sure about this change, but it makes profiling it easier.
Replace dsave stuff with a more sane logging system.