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

### Type:
* Refine exception hierarhcy and use it for detailed error reporting.
* Remove `logger`s from `Table` and `Validator`, so the classes 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.
* Simplify `Validator`; aim to turn it into a simple closure.

### Type test:
* Test new API.
* Use the new API to make tests more simple and intuitive.
* Add a bunch of new tests.

### misc:
* Remove unused imports.
Python API visibility is typically not enforced, but followed by convention through the "consenting adults" philosophy. This is why Python doesn't have visibility keywords. We should follow the language patterns here.

See these two answers: http://stackoverflow.com/a/6257141/126342