fixed the code generator.

fixed, altered and generally made the test code generator usable. it is
now operational and fit for porpoise.