Move detectLanguage, SetFormality, Direction, IsRTL to dedicated file. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>