issue/1: Optimize matmul.py by abstracting out common testing functions and adjusting testing structure