Layers can now be deleted

This comprises the bulk of the work necessary to assemble basic layered
images, which means attention can now turn to reading/writing layered
images from/to file.  This is necessary for not just loading/saving
layered images (obviously), but also for Undo/Redo functionality.