Register a shutdown function to close the session instead of closing it in the tep_redirect() function
Add tep_db_perform() equivalent
update database queries to use the new database class