extract snapshot and metadata functionality.
add 'potemkin' dependency.
add type inference namespace + tests.
add database access namespace.
replace functionality/test with functions depending on the new namespaces.