Improve type.Table. Validate types.

Depends on #24.

### Type:
* Rewrite of `Table`:
  * Don't create new `Type` objects; reuse AST nodes.
  * Store type info using only dictionaries; leverage `__eq__` and `__hash__` of the respective AST nodes.
  * Simplify code: use `try` blocks instead of double checking.
  * Allow cross-referencing of user-defined types and constructors to ease type inference.
* Add type validation.
* Fix bad line info in error message.

### Tests:
* Add complete suite of unit tests for `type` module.
Define a `_check_type` function that returns the `mock.success` and perform a `should.be.ok` or `shouldnt.be.ok` on that, as per the other tests.