add cordova support

Basically copy-pasted from websql.js in PouchDB, untested for now.