Added a matrix datatype and implemented terrain rendering