Bug fixes

Various bug fixes to the QSTEM/Master to make it workable while C++
refactor is under development.  Fixes file overwriting and other IO
issues mostly.
strcpy_s -> strcpy for Linux compatibility