This contains an experimental implementation for file exporting.
This contains my changes, it will be removed as soon as upstream catches up.