Completed data provenance functionality for refinement.py