Added rotation matrix and other misc. utility functions.