Add close function to read stream, readd dofile and loadfile, warn when setting global variables.