Refactor MySQLi (incompleted, only compilable now)