Define the variable `global_environment' and use it
Use the Stream.t instead of in_channel

The Stream.t for inputing is more easy to test and debug because I can
use the Stream.of_string to generate such a instance of this type and
doesn't need to type them every time. And I can write some test cases
in literal strings.