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