Add a stub for tty module. Implment fs.readFile/readFileSync.

Also, added a global (to each module) __dirname property as per
http://nodejs.org/api/all.html#all_dirname