Fix #370: Disallow export of local methods / variables
Fix #369: Test prohibition to export names containing __

This already worked (unlike what the ticket said). This commit only
adds the relevant test.
Merge pull request #382 from gzm0/bugfixes

Bugfixes