pid/gid mess improved

Not sure if dependencies are correct. please check.
First, I thought define per-process state as show here. But really, to prevent bloat of stupid code, I decide to use just zero instead of variables for definig permissions of the process. After that I have commented unused part of per-process state.