Database class to PDO, a few tests

Not yet stable, contains a few errors too, but I'm lazy ok.