some container serialization cleanup

Have json and xml use common record cleanup code.
Do a somewhat better job of parsing extensions from content-types.
Use a real XML serializer.

Change-Id: I10e14dffd1da590b4fd180b4d33ab5de862e2b55
Fake http_connect in test_replicator test

- mock http_connect in replicator.test_delete_partition test to not
  connect directly on 127.0.0.1 (which is not always avail on non
  linuxies).
- Fixes bug 1203907

Change-Id: I2622223c9fe5a3db2a113b6cd8d028a5db0915a7
give value [] if disallowed_metadata_keys is None

The default value of DiskFile.disallowed_metadata_keys is None. And it
will be iter in following codes even if it didn't get a new value. So
it is necessary to give Diskfile.disallowed_metadata_keys an empty list
in __init__ if the default value None is used.

fixes bug #1206740

Change-Id: I8454eba47b2c691166924356ab33b0235a800951
Just a tiny doc fix for a Sphinx warning

Change-Id: Iede31212065eafb94fd29a63103e1e73e2de770d
Merge "give value [] if disallowed_metadata_keys is None"
Merge "Fake http_connect in test_replicator test"
Merge "some container serialization cleanup"