Polish CLI tester code

Reduce duplication by extracting FileOptions class to be shared by
both the RunCommand and the TestCommand.

Also applied minor code convention tweaks.
Apply source formatting to samples
Polish

Minor formatting and consistent copyright header.
Polish