Move matrix transform functions into their own file