use to_function
add index that's compatible with cloudant search
adding some ending newlines
Merge pull request #3 from dimagi/cloudant-search

add index that's compatible with cloudant search + cleanup