Refactor for extensions

The most important parts of this code allow the Scratch website to override certain extension related code to provide UI for extension developers. Some files that didn't seem appropriate here were removed.