Add test for module exports and fix last remaining export bugs.