Add the CTF management code from the demo/volume-sandbox branch

This continues the steady march of pulling in features from the experimental `demo/volume-sandbox` branch. This replaces the save/load context menu actions in the CTF editor with a `CtfManager` class which allows a more user-friendly CTF-wrangling UI to be built.
`keyfunc` decides how an index (or key, to keep with the same terminology) is generated when a value is added to the function. The function then uses the key to insert the new value so that values in the function are ordered by their keys. The CTF editor uses the first item in the value tuples as its convention.

For example, in a simple 2D piecewise function using the same convention, you can think of the first item in a value tuple as x, and the second item as y. The x axis is monotonic and the keyfunc ensures this.