Move from mysqli to PDO, sweeping style changes

The blog backend now uses PDO. This is working solution that I came up with
from following a PDO example from php.net, so this might not be the best way to
use it.

I also added a bunch of style changes and renamed some variables to add some
clarity to the visual garbage the code was (It's still not that great).