Modification of ketmar's patch to fix AA byKey/byValue to avoid performance hits for normal AA calls.

Fixes: https://issues.dlang.org/show_bug.cgi?id=13410
Make all foreach uses of buckets use cache
Take advantage of cache where possible when we know 0 nodes existed.
Added helper method to fetch and update first used bucket automatically.

Updated uses of firstUsedBucket that can update the cache.
Merge pull request #979 from schveiguy/issue13410

issue 13410 -- Performance problem with associative array byKey/byValue