Fix issues causing tests to fail in some browsers

Issues corrected:

* The sandbox test was occasionally failing because the global $ was
  changing for some reason. Cleaning up some references and making the
  normal installation test use the same teardown as sandbox seems to
  have corrected it.
* Firefox seemed to have an issue with the test making parallel AJAX
  calls using $.when. It seems like the then clause was being called
  before all of the calls had completed. I made the second AJAX call
  contingent on completion of the first and that seems to fix the issue.