Finish some JS modularization