bring back code that uses export and fix tests

partial revert of 1fdebc1dc4881a00766f7c2b4b2d8ee6ad6e79b6
9d9201c3b4Andrew Kelley committed on 12/19/2017, 7:39:43 AMparent27ba4f0
19 files changedLine totals unavailable