improved content-negotiation

also refactor tests
added a macro for resolving handlers
removed bidi references
Merge pull request #3 from agarman/master

improved content-negotiation