Add a matrix library and switch collage over to use it.