Utilities for dealing accept headers

Hi Reto, 

this is a pull request with the work I've done in pulling your code from the Clerezza branch and merging it into the P3 library (with accompanying tests). I've added myself as author to the classes that saw the most changes as I wasn't sure you'd want my bad code attributed to you ;-) feel free to remove it. Thanks.