Map/Reduce functionality for PouchDB without using eval()