Rewrite algorithm for JDS.exists_with_casper() to be more complete.