Add resize benchmark to test suite

Some minor refactoring to make the resize functionality testable with benchmarks.