Query Optimization

Improved the speed of the category, subject, and tip select queries a
little.