(daleharvey/pouchdb#1658) - add persisted indexes

This implements persisted indexes (using _design
docs, ala Couch) by tying together the indexable
string from pouchdb/collate and the Plugin Data
API from daleharvey/pouchdb.

The tests have been modified to test both
persisted views and temp views where appropriate.