Major changes to implement the guts of coord_engine. A few unit tests are broken.