Optimize splitAt.
Optimize take.
Extract findSplitBoundary from splitAt.