Split various functions into separate files, more modular design.
Removed old files.