This adds multiple improvements around how we eal with provenance
Changes proposed in this merge request: