core: refactor export source checking into separate functions
core: Fix #295: Check for duplicate exported names in module parser