accept header content negotiation

* look at wildcards */* and main/*
* return a 406 when nothing matches the accept header

Squashed an improved version of #521