Added checks for doc max key/meta/value size, esp. in index update.

In most cases it's appropriate to propagate the error returned from e.g.
fdb_set (as an exception), but when updating an index it's better to
skip the offending key and emit a warning, rather than fail the whole
index update.
Added logging API.