Re-implement relevant logic from node-pseudo-l10n and add support for exclusion.