Add MySQLi support, revamp a bit