Added Attributive and Attribute
A whole bunch of refactor
Added _id instance method and fixed document type detection