Inside Political Parties: Factions, Party Organization and Electoral Competition