Update to clear button code

There have been a couple of updates to the code written for the Clear Button. These are chiefly:
- The centralisation of the AJAX error alert
- The removal of an assertion in the clearance test.