Allow command line option to specify number of repetitions

Refactor code so that sample output can be repeated specified number of times.
This allows to continuously output logging statements and makes it easier to
test log output tools such as Log2Console.