Updates to shell globbing in run-example and spark-class

I was running into some shell problems & warnings that I couldn't figure out.  It turned out I had a few jars left over from previous builds.

There were a few inconsistencies in how shell globbing was done, and some places where the code assumed only one file could match a glob, with unsightly consequences if more than one file matched.  I wrote a couple functions that handle globbing in a more consistent way, and use them in the workhorse scripts.  With these changes it should be more obvious to someone like me what the problem is.

I'm not a Bash expert, BTW.  Much of Bash's syntax looks screwy to me, if there's some better way to do what I did, by all means modify.