Separate options parsing from running dumpstate

This refactor allows accepting options in other ways, for eg
via binder calls.

BUG: 111441001
Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test
Test: adb bugreport
Test: interactive bugreport
Change-Id: Id27c917a3b51e1b9c0485ef3ff473b3cf22243df
5 files changed