add check for out-of-order insertions
add support for variable-length stream ids