Started cleanup of main experiment code.