Added a position column and 2 new functions

added countmenus to count menus in a group
added get_next_pos to find the next available position in a group