Made database objects enum sets non-local so they can be used in extensions.
Also added policy_key_cmp() that didnt make it in the previous commit.
A TODO bug for later
Add key_data_list_get_for_ds_gone()