Refactored Reed-Solomon so it can be used with different GF(256) primitive polynomials