Re-organised the symbol table.

Grouped the code by functionality, not by algorithm.