Use information of application site, to reduce possible arities.

Closes PR12905.
Small TR fixes.
Fix up lazy-requires and dynamic-requires in TR.