Fix XML handling of member links (bug 1156594)

This is a was revealed as a blocker for the default_project_id scoping
tests.

Also improves test coverage of XML de/serialization invertibility. The
tests were previously sensitive to things like attribute ordering which
are not relevant to test results. The fix is to compare canonically
serialized XML instead of whatever lxml spews out.

Change-Id: I003583038421d35aadbc781144d4cafb09392db5
Test default_project_id scoping (bug 1023502)

Change-Id: I14361812980e27b6d3365055586c264e48a25a3b
Utilize legacy_endpoint_id column (bug 1154918)

This column was created in migration 11 but isn't used because it wasn't
added to the model definition. Attempting to store data here ended up
putting it into 'extra'.

Change-Id: I02680b5213f09fe3cddcf5365104554d3e6d6b8a
Ensure delete domain removes all owned entities

Deleting a domain should delete all Users, Groups and Projects
that are owned by that domain.  This is intertwined with making sure
that deleting Users/Projects clean up their relevant Tokens and
Credentials (raised as a separate bug, bug fixed here).

To help avoid inadvertent deletion, we insist that a domain must
be disabled before it can be deleted.

In implementing this change, it was discovered that the exception
CredentialNotFound is referenced in the identity backend, but
never defined - this was needed here for the unit tests. This is raised
as a separate bug, and fixed here. A further bug has been raised
that this indicates we are lacking in negative testing for
Credentials (not fixed in this change)

Fixes Bug #1097995
Fixes Bug #1155921
Fixes Bug #1155924

Change-Id: Ibc926f8212fb9bd4426088339a21002a07c86984
Merge "Ensure delete domain removes all owned entities"
Merge "Utilize legacy_endpoint_id column (bug 1154918)"