feat(compiler): Backport DirectiveBinder API from #1178 to allow
gradual migration.

Originally authored by @yjbanov