Add functionality for smarter routing

Mostly works - still can't get the stupid quiz page to reload right.
Gotta get some sleep though - I'll try to fix in the morning.
#27