Cleaned up and restructured code

Smaller classes with more clearly defined tasks.
Merge branch 'rdf-serializer' of https://github.com/Wikidata/Wikidata-Toolkit.git into rdf-serializer