I fixed the transformations problem. It wasn't broken, I was just using quaternions incorrectly (I had forgotten that w is cos(theta/2) and not cos(theta).