Encapsulate type stuff

No new functionality, but I cleaned up/simplified the type stuff so it should make it a lot easier to add types and debug.
Before, our output path was ignoring the app name for writing to file, yet we were still using it to modify our import path. See test/fixtures/vanilla/output/extended-comment-activity.js.

It imports from 'my-app', but writes out to 'app'.