Keeping track of trails with Node.js and CouchDB