Refactored to abstract factories for lattice implementations. General clean up. Still WiP.