Emit just declarations, not definitions, for external symbols.
Enable most of the missing A/B tests for casts.

This is possible after fixing asm declarations of external functions,
and providing implementations for the cast helpers.