Extract database from record argument

Also update the note regarding existing (design) documents; using
couchbeam:doc_exists/2 does not help since it seems to always return
true, even when the database is empty.