Removing usage of util.js from plugins/rehost.js

Also doing some minor changes for better error handling and reporting.