Move chooser.js into common.js