add stuff to util, add some tests for util
fix how we store metadata -- inherit documents and avoid overwriting documents