Moved some functions from webpage.js to webpageUtils.js