Codegen: Result class support for Matrix

This was partially included already but was missing an import.
I don't think this is used by anything yet, but future codegen
work use it.