Export framework

Okay, let's see if this would merge right ...

There were a couple of conflicts with 70-ish migrations that I had to merge by hand.