Finished off the runs cleanup code and added some limited documentation.