Added a rotate function for the matrix class

Added a method that rotates the matrix clockwise or counter clockwise.