Add HEAD requests for _all_dbs, _all_docs, datebases, and documents

HEAD requests are useful for testing existence of databases and documents, so I've added them as HTTP methods. Only returning the headers is handled automatically by Restify, so I didn't add unit tests of the HTTP interface.

I also took the opportunity to consolidate requires in instances where the handler function is used more than once.