Rewrote the setup, added PDO support and some other changes