added error checking to mat_inverse
some misc changes
made a header file for mat_libc.c