This commit reapplies the category refactoring for PR review purposes.

Revert "Revert to old category module"

This reverts commit d1e68fb4f63e421bc5378ac0704c0581d8a92ab1.

Revert "Reverted Categories module back to DBObject for the time being."

This reverts commit 8d61c80f38a9f6a3068b8db8047e3c7101942922.