Working to make wsq library thread safe.
At this point it doesn't have read/write globals or statics, but it doesn't work.