Implement modifying environment variables, fixes #289