Issue #36; support extraction from a stream.

Here's an implementation of 'extract-from-a-stream'.
Please rename this to `extract` and flip the arguments to make it consistent with the API.