A Theory of Crowdfunding - A Mechanism Design Approach with Demand Uncertainty and Moral Hazard