Rewrite split-into-monotonics, fixing a bug not caught by our unit tests. (The buggy version did not understand that in a monotonic sequence two consecutive items can also be equal, they don't need to increase or decrease).