Redesign API of type module. Use refined exceptions; drop loggers. Improve type tests.

### Type:
* Type: Replace `Validator` class with simple functions.
* Refine exception hierarchy and use it for detailed error reporting.
* Remove `logger` from `Table`, so it can be used in cases where line info is not available. The semantic analyzer shall be responsible for notifying the user for any errors caught.

### Type test:
* Test new API.
* Use the new API to make tests more simple and intuitive.
* Add a bunch of new tests. Groom old tests.

### misc:
* Remove unused imports.
This is a proposed refactoring that should be carried out by anyone curious enough to dig the code. Issues are good for more important things, and we shouldn't clutter them with little details.

That's just my view. Anyway, the code has been refactored. :)