Changed db handling to PDO, updated documentation