Move function splitting into its own module.
Remove some unused imports
Cover more core files in .gitignore.