Clean up codegen a bit.
Add asserts when creating instruction represenations.