Bug 1021569 - rewrite clear-stage-app in javascript

but let's file a follow up for it.