added a document class and a cnobject class to make the objects hashable