Fix for advertised encodings with mime version included, factor callback functions into own file