Add new Term classes

    Most of this has already been reviewed before it was merged into
    https://github.com/wmde/WikibaseInternalSerialization/tree/master/DataModel
    
    This commit moves the code to DataModel, adds tests, adds some validity
    checks and adds some new getters

This is part of the evil plan to split up Entity as per #22. And the new classes are essentially already used by WikibaseInternalSerialization.