1. change from rhino to script engine to allow better error handling
2. log javascript errors as warnings
3. Change script parameter ordering so least used comes last and can be ignored