Removes some unnecessary synchronized blocks, and moves some fires outside the synchronized blocks.
Adds AdvancedAttributesAwareCodec that can handle attributes that are valid for all codecs and fixes parsing them. Adds handling of ptime for one of the codecs.