Converted matrix.c to a library.