Add SQL upgrade for events constraints; put them in sorted order.
Simplify queries for getting judging queue.

Multi-step process to get judgable problems and teams not needed
anymore due to earlier refactoring.