Document as base class, fixes #9

@smathy what do you think about this structure, where document is what the "models" extends