Code Tidy/ separation of concerns

Separation of code from the UI ( in progress)
- input file read/write code moved from UI to InputFile and OutputFile