Cleaned QPersistence code. Moved methods etc. Began writing unit tests.