Moving the page handler out of main.py

Also updated the delete handlers to use the superclass more