Add support for updating the environment from prep_commands.

Reviewed at https://rbcommons.com/s/twitter/r/1222/