What role did the church play in daily life during the middle ages