Reorganized code in preparation for separating JavaScript functionality
into a separate file.
Moved JavaScript code in WeaveAPI.as to JavaScript.as