page: move dispatch into class.
page: move dispatch into class.

The logic is still messy and ugly, but it's a bit neater and more
organized.  It also requires closing over fewer variables in favor of
using explicit instance variables.

Signed-off-by: brian m. carlson <738bdd359be778fee9f0fc4e2934ad72f436ceda@crustytoothpaste.net>

bk2204/daniel-ruby,bk2204/daniel-ruby