Refactored Context::_initScripting