Add working JS boilerplate in MAIN to test JSAPI. Needs cleanup. All warnings and errors fixed.