Set up map function to include key and rev values.
Fixed delete function so it works!