Autonomous Network Creation and Local Grouping in M2M Communications