Ported JS execution from 2.0 to 1.X.
Merge pull request #83 from dsafar/CB-208

Ported JS execution from 2.0 to 1.X.