New input file chooser, big refactoring of code.