I'm quite sure Machado was trying to miss the bag because it was intended to be a late slide, which means he would arrive at 2B a lot sooner and with a lot more momentum than usual. I think his intent was simply to overslide 2B as he in fact did. I do not think he wanted to get Pedroia, however, and he certainly acted as though he did not--and that's the way Pedroia took it. He was looking for speed to 2B to beat the throw and not to nail Pedroia.
As for Barnes, I have no problem agreeing it was simply a terrible pitch, but, however, with serious intent to hit Machado.
FWIW, my initial interpretation of that slide was the same as yours and I in fact compared it to something Ty Cobb would have done--come in with spikes high.
Two things changed my mind. First, Machado's actions after the slide when he grabbed Pedroia who was going down. This suggested that spiking was not his intent. Second, Pedroia's reaction, which was that it was part of the game and not malicious.