Generalized algorithm
refactor
Implementing the factorization for polynomial over finite-field