upgraded sgscript, moved xgmath out of exe to share interfaces