Add mysql, mysqli and PDO support

- new log message queue
- Include all files first, then do stuff
- Allow to completely replace the DB class

PDO seems to work.

Checked: install YOURLS, add/remove/edit link, stats.

Change load order

- Include all files first, then do stuff
- Allow to completely replace the DB class

Code cleanup & new log message queue
Merge branch 'issue1348' of https://github.com/ozh/YOURLS into issue1348