Fix an import error
Moved courseexists over to PDO

This is one of the last methods that still use PDO.
Remove unneeded functions

There is no sane way of writing these using the new database system and
they were unused
so let's just drop them.