Renamed "cumsum" "weight" and added function prototypes for undoing and finishing splits and merges.