[thinp] factor metadata-generator.rb out of RestoreTests