Change type of toCode and fromCode
Add `groupTransform` function.

Add public Matrix library. Clean up and debug matrix implementation.