Somewhat new design

The C version was really slow with the old design, so I changed the in-place merge to use three separate steps: merge subarrays that are already in order or reverse order, extract the buffers if needed, and merge the remaining subarrays.