Implemented the symbol table cloning functions

I have not tested this code. I have written a lot of it over many
days and want to get it into version control. The next step is
testing.
A few tweaks; it now compiles and passes the old test suite