move code from group menu module. add group context in hook_init