Bug fixing Document Types, Media Types, Macros

Fixing final issues.
Document type - mapping and hashvalues

Getting the hash values right when we're mapping id's