Fix a couple of issues.

Two issues found while implementing a site using this plugin:

1. interpolate was crashing on the last part[i] iteration because parts array is often one element larger than args array.

Fixed by adding graceful handling for undefined args[i].

2. In my tests, args.length was never equal to 1, so the callback function was never being called. This was trying test that the last argument was a callback, but wasn't working.

Fixed by changing the test to look at the last arg and check directly that it is a function. The callback is now called as expected.


These fixes allowed me to write queries like this:

    db.where('this.rec.address1.match(/?/i) || this.rec.address2.match(/?/i)',searchFor,searchFor,function(recs) {
        $.each(recs, function(i,rec) {
            console.log(rec);
        });
    });

Previously the query plug-in only worked if the query string ended with a ? placeholder.