Added some more helper function needed by next commit.
Better fleshed out sequence and block decoding.