DeepData -- add helper function channel_ptr() and deep_value().
Fix bugs in IBA::flatten

The main problem was that IBA::flatten was written assuming that alpha
values were "cumulative", but in fact they are "local". Also, we didn't
properly distinguish between the alpha & color channels that are
"premultiplied" values, versus the Z channels which are by definition
not multiplied by alpha.