Merge "Move implementations of matrix functions into driver/runtime."