Add 'daemon' as a dependency.

This is used with subprocess and not reached by any import, that's why
we need to set it explicitly.
Some pep8 fixes and code cleanup.