Cleaned up utilities in widget casper js tests
Added new utility functions to the casper.js testing utils.