[TASK] Cleanup JavaScript and module index

* Cleaned up JavaScript to please Google Closure compiler
* Moved spinners with labels to Index.html so they may be localized
* Factor out the message status switching to a function