Initial implementation of API errors data structure

This just provides an initial implementation of the spec compliant error data structures. Most everything is based around the `ErrorCode` type providing support for assembly and marshaling/unmarshaling.