Add checkbox to optionally generate a working example in the Splunk SDK for Java project type.

Also did some cleanup, removed unused imports, unused variables, etc.