Moving event functions to class.event_manager.php, moving code from backend.php to index.php