re-wrote writeSnapshot function
Merge branch 'master' of https://github.com/bwest87/livedb-pouch