Separated out graph and pipeline functions. Namespaces need rearranging at some point. Added missing ontology definitions.