Implement container inheritance

This pull request is based on the earlier service inheritance pull request.