refactored matrix type to better expose relationship to llvm type system