Switch from 2d tuple coords to 3d Coord adt

Also introduced helper methods from2d and to2d to make the switch easier