[idl-generator] Add support for self-defined JS function

Developers can now write their own JS file for extension.