Database Improvements

Ongoing work to replace all of TheyWorkForYou's raw queries with nice shiny PDO prepared statements.
Might be nice to use the house constants here rather than numbers since we're tidying up