make metadata storage pluggable

KEY is synonym for INDEX, can we use INDEX instead?