Split menu out into separate file.
Cleaned up matrix.c.