Refactor parts of DataType, write tests

Refactored DataType::generateArray(), made the subclass tests not
affect coverage for DataType (since we should test the class itself and
not get fooled by coverage from the subclasses), and started writing
actual tests for DataType using reflection and mocks.