Add some more tests to code generation
Add some more tests to code generation

This commit has near-100% coverage. The only things remaining to test
are some error handling and some impossible conditions.

Muon/redux