To my knowledge, M-Sport are doing most of the preparation job in house. I don't think Cosworth are involved.
About the price, you have to understand that this is what is called a customer car. This is a full-on race car, but prepared as a fairly large production (in racing, this means more than two running at a time LOL). This makes it possible for a team to actually go to M-Sport and sign a deal for two cars plus spares for an entire season and still come under 1 million bucks. Top class WRC cars used to cost in excess of a million dollars a piece back when manufacturers were not limited to a maximum budget and exotic materials and processes were not banned yet. So a fully prepped, FIA certified race car for a quarter of a million is an extremely good deal. And that's why you see a lot of Fords competing in the WRC these days. Those are a steal... and are still very competitive. Still, without the full backing of a manufacturer, they have no chance of beating the likes of VW or Citroën. I wish Ford got back in the game with a real manufacturer program...