Add support for DB open modes

The tests won't pass in Travis until we merge the maxminddb changes.