Move the benchmark logic in a module

This allows to use the bench tool from other applications