Incremental decoder

Implements an incremental decoder as discussed in issue #9