Handle both the modern in/outports system, and the legacy exports system. Fixes #118