Implemented versioin update mechanism and reorganizing some functions in SMR.jsfl