Refactor mysqli to PDO database driver.

See #31