Agree 100% that it is utter madness. I'm a Republican and I'm aghast that the party chose Trump. Both parties chose terrible candidates, and the ones running in the primaries weren't all that great either.
However, I don't agree that there is something that can (or should) be done from outside the parties to reform them. I have to believe that sooner or later something will give. The problem is that more and more people are leaving both parties, with independent voters reaching the highest percentages ever. What that results in is the remaining members getting more and more radical, with the parties finding less and less common ground. And it doesn't appear that things will get better as the Democrats look to get more radical after the results of this election. It's going to be harder and harder for a candidate to appeal to the remaining party members to get nominated, and then appeal to the more moderate independents.
Each party needs to come back to recognizing that they need to also appeal to the independent voters. Instead the independent voters get left with a choice of two terrible candidates. It's hard to imagine the two party system breaking down, but I feel we are on that path. If the current parties keep getting more extreme I feel that there will eventually be a movement for a new more moderate party (I doubt that any of the existing third parties will fill that void). In my opinion, perhaps the "Rational Party" would be a good name.