Moved code around to implement the compiler.

- the advanced-type compiler is almost finished;
- the basic-type compiler still needs some work.