Overhauls low-level splitting functions to be cleaner.