Create a cmdfile verification entrypoint

Also, refactor common stuff from tradefed.sh and verify.sh into script_helper.sh

$./verify.sh --cmdfile cmdfile.txt --cmdfile badcmdfile.txt --cmdfile no_exist.txt --show-commands; echo $?
Successfully parsed 4 commands from cmdfile cmdfile.txt
1: [recharge, --max-battery, 0, --noisy-dry-run]
2: [recharge, --max-battery, 1, --noisy-dry-run]
3: [recharge, --max-battery, 2, --noisy-dry-run]
4: [recharge, --max-battery, 3, --noisy-dry-run]

Failed to parse badcmdfile.txt:
com.android.tradefed.config.ConfigurationException: Macro call 'f3' does not match any macro definitions.
Failed to parse no_exist.txt:
java.io.FileNotFoundException: no_exist.txt (No such file or directory)
1

$./verify.sh -q --cmdfile cmdfile.txt --show-commands; echo $?
0

Bug: 20193460
Change-Id: I51a344f5089fd9eb8632629b85dd1548d5ecf6c8
11 files changed