Bug 1021569 - rewrite clear-stage-app in javascript

filed. https://bugzilla.mozilla.org/show_bug.cgi?id=1026966