don't pass browser ref as an argument to handler

The browser is a singleton already, no real purpose in that…
migrate from explicit handler classes to std::function

More flexibility in the handling of events is offered and all are optional (not really sure how useful that is but hey).

Added bonus: arguments to handler functions are now always Ref types, yay.