Added logic for reading/saving environments in the file editor