Reorganized code so that it now relies on config files.