Added write_models, write_energies and filter_values functions to get_energies.py.