Make BatHashtbl.modify_opt/def resize the table

As pointed out by @jj-issuu in issue #560 "The functions modify_opt and
modify_def in BatHashtbl never resize the hash table, so they have O(n)
performance if the table is never modified through a function like add
or replace."

This fixes the issue by implementing the functions using the standard
add/remove/replace functions.