Optimizing some of the Hash functions by returning early.

When no deep path is going to be used, it is 11% faster to just access
the property directly and operate on it.
Merge pull request #3517 from cakephp/3.0-hash-optimize

3.0 hash optimize