Rebase and fixup for the 396 networking patchset

Recent changes in the master made the networking patches sent by @marios[1] incompatible.

This is a rebase of those patches against the master plus a few fixes so that listing networks and subnets as application/xml works properly.

[1]: http://tracker.deltacloud.org/set/396