Merge "Rename key_dir to metadata_key_dir and refactor" am: a7463139 am: 8cf1eda0 am: 48c403b8 Change-Id: I4df8daf1210a31b4ae0e32ee8c04f8f7acdc827b