Added global parameters

Added a set of new global parameters to the experiment code to make it
more easily customizable, and generally tidied up the code.