Yeah, the Ending...
A few thoughts...
First, John almost certainly murdered Caleb. This is evidenced by his phoney story that Caleb just up and left after toiling to bring electricity and banging Ann. We saw Caleb concede that the shining city was in all likelihood a myth. We also know Caleb openly showed affection to Ann the morning after making love, and he not only saw through John's lie about supposedly masterminding a seduction plot, but called the guy out on it.
As for John's actions, they're defensible in the sense that he has every reason to believe Caleb can kill. His life is in jeopardy because he's relatively less useful after electrification. In a state of nature, we're driven by fear. Even if Caleb has no intention of killing John, John believes he's a threat (and vice-versa). Forget about genetic oblivion, you're never going to be safe with a rival male near by. The waterwheel is a mark of civilization, but the cooperation it demands is temporary.