Select/Remove vertices joining only two edges
Use Select Similar  menu in vertex selection mode to select vertices which share only 2 edges (in 2.79 it is Shift+G). Switch to vertex selection mode, select one vertex falling into mentioned category and with it selected run Select Similar > Amount of connecting edges.


  Amount of Connecting Edges
  Selects all vertices that have the same number of edges connected to them.


Select Similar in manual

Vertices which share only 2 edges will be selected and you can dissolve them with X * > Dissolve Vertices*.