Split popup.js into modules.