Some code cleanup, and also adds the ability to run on openshift.