Add a JS function (nwm.exec) for doing a synchronous process execution and getting the output