High Court says plans that threaten family legal aid are 'unlawful'