return with error if filter is not a function.
minor readability change
use console for console errors.
updated registrations transition to return a doc. medic/medic-webapp#714

WIP using the new transitions API which expects a doc to be returned if
there are changes.
WIP transitions refactor medic/medic-webapp#714

Don't bind to a separate changes feed for each transition.  Bind to all
docs and process transitions within node serially. Reduces HTTP
operations significantly to process a document.

Expecting transitions to return a doc if changes are made. That doc is passed
to each transition in a queue. At the end of the queue we append an audit.save.
Also replaced initial GET on a change with include_docs option.

Also found a bug in couchmark in index.js line 61. We should include an
endkey:

```
diff --git a/index.js b/index.js
index eec5f16..df03b73 100644
--- a/index.js
+++ b/index.js
@@ -55,7 +55,8 @@ _.extend(module.exports, {
             db.view('couchmark/stream', {
                 descending: true,
                 limit: 1,
-                startkey: [ forDb, stream, {} ]
+                startkey: [ forDb, stream, {} ],
+                endkey: [ forDb, stream ]
             }, function(err, rows) {
                 var since,
                     latest;
```

without an endkey couchmark can potentially use the update sequence of a stream
with a different name.