Added a grid graph structure, and minor file refactor