Test dirty logic

Several tests fail---they are fixed in the two subsequent commits.
Raise exceptions in project_delete

... rather than returning them, which is wrong.
Change order of precondition-checks in node_detach_network

Specifically, test that the node is in a group before checking that it's
connected.  Logically, we should not check for networks connected to a node
that does not even belong to a project.  Secondly, when we start doing
authorization, we will need to check that the user is authorized to see the
project before potentially returning information about the node (namely, that
it is not attached to any networks.)