Add link type inference to save stream.

Also consolidated C++ code back into a single file. The many
interactions between the new writer and reader classes (especially with
the future injection writable side of the live stream) made it too
complex to keep the separation.

Also removed `isClosed` method from the live and replay streams, but
added a 'close' event to compensate (documented by the node stream API).