Tidy up inclusion conventions for *_sm.c
Make variant_array_metadata static