A Unified Theory of Voting