Refactor perform_experiments.c and improve literate documentation.