Made changes for compatibility with new Cortex ObjectPool.

The changes are all straightforward, but we need to consider when is the appropriate time to merge. When we upgrade our Cortex install, we'll need this patch, but if we want to do Gaffer installs before we upgrade the Cortex install then we'll need to make sure this patch isn't in. Do we know when we want to do the next Cortex install?