Merge refactoring and performance changes back

Opening this pull request as a place to discuss any issues merging my changes back, such as getting local-tld support working on Mac. I'm having some trouble testing that at the moment since my laptop's processor doesn't support whatever hardware virtualization stuff I need to run OS X on VMWare.

I've made the performance changes work only if the CouchDB instance supports `/_db_updates`, otherwise it'll fall back to the one request per replication system.

Also needs fixing: subdomain routing for Nodejitsu deployment. We'll need to fire up another server to listen on port 80 and proxy requests depending on subdomain. I also haven't tested the performance changes on Nodejitsu yet as I'm hoping to get Iriscouch to build the db_updates branch for me first. We could potentially host our own CouchDB instance to test again if needs be.