Added ray class which can test for intersection with triangles.
Changed return type from pointer to value in matrix factory methods.