Provide the document with category objects

Assuming that people don't actually store AI::Categorizer::Category
objects in their database, this patch will make sure to turn category
strings into objects, before creating the document object.