power: Finish moving system-reliant code out of Daemon.

Copy the Daemon class's hardcoded paths to member variables
so they can be overridden by unit tests. Also update it to
run commands through DaemonDelegate (so tests can capture
the commands instead of executing them) and to get its PID
from the delegate (to make it possible to test code that
uses PIDs).

BUG=chromium:628422
TEST=manual: tests pass and powerd still runs

Change-Id: I8ccf4a7d4273270c4aa30e0ce5d8c22fa0f4a0aa
Reviewed-on: https://chromium-review.googlesource.com/365610
Commit-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>
8 files changed