Fix encoding/decoding in some Enumerations

Some enumerations would be incorrectly encoded by using the ordinal.
Now they are all encoded and decoded by their value property.
Don't use markWriterIndex() / resetWriterIndex()

This pattern is dangerous when passing the buffer off to uncontrolled
encoders because the encoders could also mark or reset the index.
Give getBuiltinTypeId() a default value

This fixes an NPE when the class isn’t in the map and results in
unrecognized ids being encoded as extension objects.
Handle UaStructure[] in Variant