OMEXMLFormat: ensure codecs have a context

Codecs are contextual and as such their context should be set before
use.

Consolidated the codec creation logic to ensure the context is set
before the codec is used.

Closes #16.