Fix discrepency between stub graph and real graph, and clean up error handling.

Add validation logic to the stub graph to ensure that topics and resources with
relationships cannot be deleted.

Add a name to specific errors that happen when trying to delete a node from
the graph database.
Add missing tests
Add missing tests
Fix stub graph topics.get to work with resource relationships.

The stub graph assumed that the target of a relationship was always
a topic, so this failed when the target was actually a resource.
More assertions