Re-wrote getSnapshot and bulkGetSnapshot. Also renamed variables and required in PouchDB