Implement ControlStack to generate sequential ID numbers, count children, etc