[MAT-426] Code refactor to work in further complex domain tests.

This refactors the code generator to add in support for the same
level of testing as the real domain, but in the complex domain.
It also adds in better commentary regarding what's being tested.