Expand the testing guide to cover optimizations, benchmarks and how to

be more precise about what's being benchmarked.

Also, reorganise the layout a bit, to put examples directly in their
sections.