Update tests to use separate pickle. Add support for specifying history filename.