Refactoring

No functional change, just laying out the ground for the graph command implementation (#92)