Fixes to make app work in Cordova.

Not doing replication at startup - Serialising the json instead to the
local pouch.