Reasoning about Consensus when Opinions Diffuse through Majority Dynamics