Fixed various issues.

MarkovDB class had been storing object-local variables as static.
Some fixes to file saving and loading.
Fixes to the profiling functions.