More work

All queries converted to PDO except those in /install