Improvements in compiler structure (and speed!)

See the commit log for details.