Layer merging now available

Big commit, and obviously a crucial part of the whole Layer paradigm.

I've opted to provide both "merge down" and "merge up" buttons on the
layer box, when the mouse is hovered over a layer.  "Merge up" is kind
of a weird concept, and no major photo editors provide it - but I find
it intuitive and worthwhile to include.  Basically it just applies a
"merge down" operation on the layer above the active one, saving you a
bit of extra clicking.

These various Layer commands options will all be showing up in the Layer
menu soon, along with more options that don't make sense in the hover
menu (like Flatten Image or Merge Visible Layers).  Also I have yet to
work any of this into the Undo/Redo engine, so you can't yet undo Layer
merges - that's coming!

Speaking of visible layers and merging - I've gone for the industry
standard of only allowing merging of visible layers.  Hidden layers are
not allowed to merge.  This is all reflected in the tooltips, and I
think it should prove very intuitive.