Added pouchDB functionality. Also some good comments in main js file.