Cleaned up persistence.js and added docblocks