split cli module, added tests, JS code-runner improvements