Added page switching functions

This refreshes DOM correctly