Move the typesystem into a subpackage

The type system and its related code are big enough to have a subpackage, I think. So this PR does exactly that. It also addresses the module names with underscores that were introduced in #255.

Let me know what you think.