Added support for external stream decoders.

This needs testing but it should fix #14