log unexpected errors in wait_for_server
move some utility functions to ORM classes

simplify handler methods
raise TimeoutError in wait_for_server
restart the proxy if it goes down

and populate its table from the database
make HTTP requests to the proxy async
always use transient IOLoop for run_sync
Merge pull request #38 from minrk/restart-proxy

restart the proxy if it goes down