Add support for external scripts
Update the API to better match the IDL