Generalized model to dimensions other than 3.

Did not generalize tests since I know of no way to sample from the vMF
distribution in other dimensions.