Make StaticList serializer and deserializer more generic.