Optimize Finding a Category by Id

A simple optimization of category find-by-id. I create a hash of categories by category id.

First Discourse PR so let me know if I'm doing something wrong :+1