A simple way to traverse a nodejs Buffer while keeping track of position