Set autogenerated id to document in Type::addDocument method. Added some has* methods to Document
Set autogenerated ids in addDocuments method