Refactored and added listener for 'Add new group' popup menu.