Multiple stream support

Change internals of the framework to separate managing of global and stream transitions and to allow multiple streams. This also required allowing one module to be shared across the global and all streams.