Add the Matrix class to the core package