Merge menu and totals code in to core.