refactor fdsys so we have a function that mirrors a particular file

In the amendment_text branch I've also added an example in amendment_text.py for how to use this.

This is cherry-picked from 04eba53.