Move /proc related stuff to control.c