move detect js to libs, uglify ignore device func name, build