Answer is simple: Civ 5 is largely a war game. Diplomacy is virtually nonexistent. Your armies were smaller than the AI's (in their calculations), so they declared war on you.
It sucks, but what is Firaxis going to do to *really* fix the lacking diplomacy issue? No idea. I wouldn't expect anything revolutionary though, I mean look at the minor changes they've made to multiplayer over the past few months.
Answer is even simpler, really.
They're dealing with probabilities. Decreasing the chance that you'll be backstabbed doesn't mean you won't be backstabbed; it means that over a large sample size you'll be backstabbed fewer total times.