R implementation of Xavier Combelle sgf file parsing logic