Fixed incomplete metadata generation for membership aware containers and
resource attachments.

Updated example test harness and integration tests to simulate the usage
of attachments and direct containers.