Added some basic factory tests, and implemented a clean() method to wipe persistent data.