Made several changes to cleanup all the scripts:
- renamed environment constants JAVA_OPTS, CLASSPATH to match standard names
- added execClass helper function, moved classpath creation into it
- made sure to check all return values.