refactored the graph to let nodes hold a template, also moved it up to top level because java has no generic graph, so I can just use this one
renamed graph to gridgraph, because that was the idea anyways and now I don't have to do architecture redisigns, only when I need a 'real' graph
backtracking now works just fine