Remove dead code from serialize.py. Make compute_*_id static methods.