Device monitor: break out & enhance a bit

* Move device monitoring out into a separate file.
* Make device mode-setting nominally configurable via prefs (no UI yet)
* Device mode setting now responds to more triggers than just app startup
  - plugging
  - first use of a device (fallback)
Add device mode chooser UI

* Add UI for setting devices as ignored for particular kinds of mode/task
  - Device permissions "All tasks", "Ignored", or "View manipulation only"
  - All devices are permitted for all tasks by default
  - Ignored events are silently discarded
  - Switching between modes with the pointer still works
  - Fixes #40.
* Make the kinds of modes devices can interact with configurable:
  - Mode instances declare what sorts of actions they do
  - Device compat. with a mode depends on the mode's declared behaviour
* Class hierarchy simplification & API improvements:
  - all events are now dispatched via the document controller
  - mode-switching now happens in the document controller
  - modes now declare whether they support pointer-based switching
  - Consolidate freehand modes into one
* Improve statusbar messages for modifier + mouse button commands.