Algorithms and Mechanisms for Digital Democracy