Fix failing tests

# Changes
 - Fixes to some failing tests.
 - Output any JavaScript errors that occur on the page to the CasperJS log. This should help a ton with debugging in the future.