phase 1 of refactoring effort.

cleaned up all the garbage from the code gen process, and now it is building , but still needs to be filled in.