Maintenance update

split the single popup.js into smaller .js files for easier management
and maintenance.