Add tests for env serialization