Continued refactor of JavaScript
Continue to refactor DecodeSidebar, props @derek-duncan