Optimize Finding a Category by Id

A simple optimization of category find-by-id. I create a hash of categories by category id.

Fixes [this issue](https://meta.discourse.org/t/javascript-optimize-finding-a-category-by-id/).

First Discourse PR so let me know if I'm doing something wrong :+1: