Add to_array test helper and use CounterButton for more tests

The to_array helper takes a stream and sets it up to push each
occurrence to an array that it then returns. I noticed a lot of
tests were using this pattern so we could inspect the current
state of a stream so it made sense to DRY it up with a helper.