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