JSContext: major refactoring