Type: Refactor Table.

* Minimize the information duplication by directly storing AST nodes.
* Utilize the equality induced from the AST class hierarchy.
* Use dicts insted of sets to allow node retrieval.
* Implement key retrieval via named tuples.
* Return early on bad type, to avoid internal errors.
* Use try-catch expressions instead of double-checking.
* On type redefinition, report position of first definition.
Type, Parser: Add type validation.
Type: Delegate string formatting to error module.
Type: Make is_array a static method.
Tests: Complete unit tests of type module.
Type: Split testing of ast and type modules.
AST: Add dummy line info, to ease unit testing.
Type: Fix bad line info.
Merge branch 'master' into validtypes

Conflicts:
	compiler/type.py
	tests/test_ast.py
	tests/test_type.py

* builtin_map renamed to builtin_types_map in branch newast2.
* Some AST tests added in branch parser_test.
Type: Factor `return` out of conditional statement.
Type test: Fix bad test.
Type test: DRY.
Type test: Add test for `ref ref int`.
Parse: Purge all semantic checks.
Type test: Process types explicitly.
Type, Type Test: Factor type validation functionality in seperate class.
Merge branch 'master' into validtypes

Conflicts:
	compiler/parse.py
	tests/test_type.py

Conflicts due to dropping semantic checks from parser
and using new API.
Type test: Drop bogus test. Add comments to state test intention.
Parse: Reuse simple_expr rules in patterns.
Type test: Add tests for upcoming smartdict class.