CoW tree: make it possible to delete nodes, small refactoring

Make it possible to delete nodes, and still preserve the balanced
factor.

To implement this, some refactoring was needed of local functions, to
make some apply methods more generic.

Signed-off-by: Max Sikstrom <msikstrom@op5.com>