You got used to the autoglobal of the mysql resource (which was a really bad idea on zend's part). MySQLi doesn't exist outside of the scope it was created. You need to pass the resource to the functions in question.
function db_query(MySQLi $mysqli, $query)
. . .
If you have parametrized queries, you'll be wanting to use prepared statements instead. That I'd suggest writing a second function for, or modifying the first one to accept a third parameter array for the arguments, then determining if it should issue a ->query or ->prepare statement.
mysqli_init() is also not required. This is only required when you plan on modifying a few of the settings which must occur between the mysql_init and before the new mysqli() or mysqli_connect calls. There's not a whole lot of these configurations that require this though.