Summary: The ser, de and roundtrip are duplicated 3 times in the various tests, let's move them into a common library. Reviewed By: chadaustin Differential Revision: D26675989 fbshipit-source-id: 1da0bc33429795a889b72c76fa18e5fa3cb7df6f