Pull cache directory inference logic out of lib.commandline.

This introduces lib.path_util and moves cache directory related logic,
as well as checkout inference logic, out of lib.commandline and into
this new module. This is desirable because we want cache inference to be
available independently of commandline (finer-grained dependencies).

BUG=brillo:1032
TEST=cbuildbot/run_tests
TEST=Trybot

Change-Id: I8637cdf886a36800ca8b85d7b283dd350e5ae8ba
Reviewed-on: https://chromium-review.googlesource.com/270191
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
9 files changed