Cleaning up node states

Adding all possible groups of states and correct conditions for
grouping them.

Change-Id: Ic4eb67049bda7a3a31cd73624840fcae58eb2e31
Merge "Cleaning up node states"