Development and unit tests for type module.

Depends on #18.