Move code from Main to new modules Conf and Nix