Remove old endslate code, fix refactoring bugs in html5.js and flash.js