use lineReader rather than readline to better handle memory leaks

... and some general cleanup

Previously, it only took a few K documents read from json to cause a huge heap.  This can be confirmed with https://github.com/c4milo/node-webkit-agent (and you would have noticed your dump grind to a halt).