array_key: move serialization method at the top.
monomial: implement serialization.