polynomial_term: implement serialization.