Substantially improve test_web_resources. Create unittests base class.

Also testing shows that default button actions weren't triggered if a
specific action was requested. Tweaked behavior to always fire the default
action.