Classmethod hydrator optimization

This PR is related to zendframework/zf2#6142, and includes tests for the newly introduced hydration and extraction caches

Reduces hydration and extraction from `O(n^2)` to `O(n)`