added sql_insert_id function, ported some more modules