Add integration test for Command::Diff

Also, this patch fixes an issue with deserialization found via
the new test.