Implement startGroup, closeGroup and define groups, curGroups

Next to do -> addGroup