erlang: add fast iter counting + more flexible db creation