Refactor benchmark.cpp, and move it to a separate directory.