migrate the negotiation example from koajs/koa and add test, refs #3.

This is part of #3.