Dijkstra to OO

Changed Dijkstra class so that it could be implemented elsewhere, such
as in a GUI.