Merge global js funcs into models.js

init, restoreInputs, validateForm, cancelModel, deleteModel,
publishModel, duplicateModel functions are commonly used by all models.
NOTE: cvrStatic has a bit difference in init(). Fix it later.