Update docs for AsyncTestCase to make @gen_test more prominent.
Add overrideable method RequestHandler.log_exception.

Most apps that currently override _handle_request_exception can now
use a combination of log_exception and write_error.

Closes #730.
Add an interface to set the TCP_NODELAY flag on an IOStream.

Use this flag from simple_httpclient (always) and httpserver (when a complete
response is available), and add an accessor for WebSocketHandler.

Also make simple_httpclient send headers and body in a single
IOStream.write call.
Clear the NODELAY flag in set_nodelay(False).
Catch and ignore EINVAL errors from setsockopt.

This seems to happen a lot in benchmark runs when sockets are closed
after a request.
Rewrite HTTPHeaders normalization to limit the growth of the cache.

Reorganize the code into a dict subclass for speed: cache hits are now
just a dict lookup, with no python function call.  (this saves about 1%
on demos/benchmark/benchmark.py on cpython 2.7)

Remove the regex-based fast path, which has not had any real impact since
we added the dict cache.
Precompile the regex used on severy set_header call.

The regex was cached by the re module, but the overhead of looking it
up in the cache added up to almost 1% of the time in benchmark.py.
Add a test that covers creation and binding of UIModules and methods.
Create UIModule proxies on demand instead of in RequestHandler init.

It would be nice to do something similar for UI methods, but it's tricker
and they are less common (there are three UIModules defined by default
for every handler).
change bind_unused_port to pass None as port

bind_unused_port was passing 0 as port number to the socket module.
This generated some exceptional behaviour on systems where nslookup of
localhost didn't returned the loopback interface.
Update httpclient.py

fix typo
add missing parameter doc
Merge pull request #779 from clowwindy/master

fix a typo in httpclient docs
Merge pull request #780 from keakon/patch-1

add missing parameter doc
Add note about frequently-seen pull request to add **kwargs to json_encode.
Merge pull request #777 from mauriciosl/master

bind_unused_port raising gaierror: [Errno 8]
Raise specific exceptions for method not allowed and missing argument