Test failure cases

Here are a lot of tests.  They all pass. (I had to fix one or two bugs to make that happen).

The big thing we still aren't testing very closely:  Group and project mismatches.  (Mostly because it's a massive pain, but also because it isn't totally obvious to me what the right semantics there are.)