optimized getTopicsByTids, single db call to get topicData, added cache for privilege/category/user data