Add commands to manipulate the in-memory dep graph

This allows the user to try out hypothetical scenarios, e.g. to see what
the dependencies would look like if a particular file or module was
removed or a new module added.