Added restart support to the stream decoder class.
Saner handling of decoder lifetimes. Need to port to Windows and test further.