Four appear in UK court on terrorism charges