Fixed FORGE-1631 - script output is out of sync and duplicated. Also improved script output streaming.