Existing check audit_storage locationmetadata checks for corrupt metadata but does not have independent confirmation that its checks are solid, so this adds test cases on this and on various helpers used along the way. This diff goes to some effort to ensure that the code used at runtime in production is the same as the code running in the tests.