Moving old wiki code into a Wiki class, removing global calls.
Replacing Database::get_user_info_from_id() (deprecated function) with api_get_user_id().
Formatting queries.
Fixing queries.
More cleaning, lots of PHP warnings fixed, fixing UI.