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)
External editing for layer content

Add UI and layer APIs to support editing layers via tempfiles, using
external applications. Currently only the default application for a given
file type can be launched, and only file-backed layers (e.g. VectorLayers)
can be edited this way (they benefit most).

Addresses #57.
Add API for flashing transient messages

Using the statusbar only for now, but there's no reason other mechanisms
couldn't be used in fullscreen mode.
API: expose the model's working tempdir

Expose the document model's tempdir as a public read-only property.

(Replace a minor deprecated call too)
App launching: better messages, more sensible EAFP

Display messages about external apps starting or failing to start via the
transient mechanism.

No method calls in try/except blocks when using EAFP quack checks for
the method's existence.
Add Vector Layer commands

Add commands to create vector (SVG) layers.

Closes #57.
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.
Support for vector layers (SVG, edited externally)

Adds the ability to create vector layers and edit them in Inkscape (if
that's your default SVG file opener). Some polishing may be needed, such as
offering a choice from the DE's recommended SVG apps, but for now this
should suffice and allow testing.

Fixes #57.

There seems to be a consensus on the CREATE mailing list that arbitrary
image-like (or otherwise) layer file data is welcome in OpenRaster
containers, and that this is the correct interpretation of the current
spec. SVG is one of the more useful of these formats, since we gain useful
text and graphics layers.

To use this feature, create a new vector layer, then edit it with your
favourite external app via the menu. When you save the temporary file, a
new entry is created on the MyPaint undo stack.

Rendering in MyPaint is ultimately via librsvg, meaning you may need to
simplify Inkscape SVG files which rely on Inkscape-specific extensions
quite a lot. If nothing displays at all, make sure your librsvg install
ships a libpixbufloader-svg.so and that gdk-pixbuf-query-loaders lists SVG.
Add initial Travis CI support
Add Travis CI build status to README.md [ci skip]
Fix layer backdrop getter tests

Fix failing doctest for the layer backdrop determination method. Switching
to an isolated "normal" mode for layer groups by default in c413a96 broke
the test.
Update lib/ code to allow headless testing

Nose uses a slightly different environment from the one I've been testing
under at my end. Removed an extraneous Gdk import as well.
Test build in Travis

Only the non-GUI parts, though - the Travis build farm boxes are likely to
be headless boxes.
Reformat & update README

Reformat README.md for friendlier diffs. Hopefully it'll still render OK.
Add notes about running the unit tests via nose.

[ci skip]
Layer groups: more discoverable, less weirdness

Make layer groups more discoverable: additional New Layer Group commands in
both the context and main menus.

In the layers panel, relegate the drag-layer-into stuff to dragging with
shift held down. It's weird (though IMO cool) behaviour, so make it
non-default. Add statusbar hints about it, because power-user stuff
shouldn't be totally hidden.

Fixes #68.
Fix exception when releasing modified space bar

Missed a base class default in the recent simplification.
Fixes #75.
External layer editing: app chooser dialog; bugfix

Present a dialog asking which application to launch when attempting to edit
layer data in an external app.

No longer error out if the app used/chosen will only support URIs. Assume
the file:// URI it will be launched with will be sufficient.

Fixes #80.
New Vector Layer: use view area, immediate edits

Instead of using a 64x64 blank SVG document for new vector layers, create
them with the current MyPaint viewport outlined, and with a document size
that encloses that outline. Closer to what people probably want, hopefully.

Creating a new vector layer now launches the editor immediately.

Show ellipses for the New Vector Layer commands: they require user input
now.
Fix painting time dialog

Previous display was "discard 16m981s of unsaved painting".
Normalize: fix coding error; optimizations

Optimize the case when normalizing 100% opaque Normal mode layers: all
surface-backed layers can just have their tiles copied into the new layer
as-is.

Fix a related exception on this codepath: looks like it was committed in a
half-finished state.

Fix nonsensical comment.