Add a bunch more unit tests for matrixService.