rewrite the script.js --> ns.js, a high performance, safer framework emebed, package front DataBase API, written in Functional style