I need the core file that powers my Testpad application rewritten in JavaScript so the functionality can be driven directly from a .js module rather than the current format I’m using. The focus is strictly on functionality—data structures and the UI will stay as they are—so I’m looking for clean, well-commented JavaScript that replicates every existing behaviour without introducing regressions. Please mirror all current features, expose the same public methods, and include a short README that explains any setup steps plus one or two usage examples. Once complete, I’ll run my existing automated tests against your file; a green test suite will be the acceptance criterion.