Full implementation of basic benchmarking, with tests