Made smatrix code thread safe by removing statics

Changed all static variables which were only being used as local
variables to be local variables. This avoids threading problems.
Merge pull request #11 from Dr15Jones/makeSMatrixThreadSafe

Made smatrix code thread safe by removing statics