Rework error handling and put top-level error handling in a domain.

Here's the domains documentation, in case the API is unfamiliar to you:

  http://nodejs.org/api/domain.html

I also reworked the connection handshake and the app booting to ensure that we have a connection to the database before proceeding. I may have broken some stuff in the process, my testing wasn't really extensive. ;)

Feel free to take as much or as little of this as you like, and thanks for banging on the agent!