Add insert_elem/3 and delete_elem/2 functions, deprecate setelem
in favour of set_elem

For Erlang versions prior to R16B, emulate corresponding BIFs