Code refactoring for better reuse.
Make deformation cache more inteligent.
closes #101.