HMM refactoring to combine 2D and 3D. 2D might be slower.
Merge pull request #60 from pkaifosh/motion-refactoring

HMM refactoring to combine 2D and 3D. 2D might be slower.