Select is now run every loop, and use the result bits

Previously most places in the code would just perform a nonblocking
read or write on every iteration.  Now, they check the read/write
bits set by select() to eliminate unneeded syscalls.

This changes many assumptions about the state of these flags, but
I think I found all the relevant spots.
Implemented control socket

Daemonproxy can now be instructed to listen to a socket for controller
connections with --socket PATH.  This is now allowed as one of the
mandatory options at startup.

Added very basic test case.

fixes #33
Renamed --stdin to --interactive with -i alias