Simplified impl based on new readyStateChange. Added substream example.