new code checks the type of console streams
resurrect the io module & Stream classes

move file write into the FileStream class, that's now implemented with libuv
this is preparation for allowing uv file and uv stream code to be easily
callable