Revamped splitting. Linking errors still thrown for some test images.