initial commit. refactored code from msmbuilder
Adding optimizer for going to cartesian from internal
Adding optimizer for going to cartesian from internal