Split Page code out of script_task.rs #2530