Changed file reading to streams and debug options

First work towards using streams for file reading. Also added some
debug options to config.json to allow debugging with workers as per
https://github.com/joyent/node/issues/5318