Added matrix class

Began to add matrix class.  Hopefully it will make this easier.