a few tweaks to message codec code and added test for unregisterCodec