[js] remove global 'apply()' function. It is no longer used in favor of Function.apply()
[js] drop global 'dump()' function. replaced by console.log()