Fixing the parties is simple yet nearly impossible. End the primary system. Get government out of the business of helping parties select their candidates. Go back to the caucus system where party members select the candidates. Left to their own devices, party members will select candidates who represent their values. This is good for everybody as the candidates and party platforms will be harmonized. So if a party is full of members who are bat $%$^ crazy then that party's candidates will reflect this. The electorate can then see the parties and candidates for who they really are instead of the current system of claiming that the "electable" candidate fits a party because it is a "big tent". We don't need wishy washy big tent parties; we can always make more tents. Pat Robertson's triumph in the Iowa caucuses is a great example of why the primary system needs to go. Pat Robertson represented the values held by the members of the Iowa Republican Party, not the values of folks who happen to vote in a primary but the actual dues paying party members. Folks who weren't Iowa Reps might consider Robertson to be a nutjob but so what? He was their candidate, not anyone else's. If a party, by selecting candidates who reflect the party members' views, select candidates who lose elections, this is a good thing and is the way elections aught to run. Parties with un-popular positions should lose.
The second aspect of the above idea is that by requiring parties to pick their own candidates the general voter, who isn't a member of a party, will stop identifying with a particular party. How many folks vote in a Dem/Rep primary but are not party members? These folks often identify themselves as Dems/Reps but they aren't. The primary system creates this false sense of tribalism. Ending the primary system ends a significant marketing opportunity for the major parties.