Optimize Category find-by-id by using a hash.
Merge pull request #2568 from lebek/optimize-category-lookup

Optimize Finding a Category by Id
TRIVIAL: Rename `map` to `idMap` because `map` means something for
enumerables.