Fixed bugs related to PDO overhaul, plus some additional minor changes and cleanup.

The PDO backend now seems to be in a functional state (at least with the SQLite driver) but needs more comprehensive testing.

Newly-created database tables will have foreign key constraints, but existing tables are not yet being upgraded to include such. (TODO)

Config now takes a path for where to store log files et cetera.

fof-db.php is still copiously peppered with debug logging, most of which could stand to be stripped out at some point. (TODO)