Updated bistream API

decoupled bitStream functions from state functions