documents and reorganizes the compiler code - part 2

Closes #97