Concurrent sessions

This lets you run multiple captures in a single process. I tweaked the interface to a few of the C++ functions, but nothing is different when using the javascript interface.