Cleanup, fixed resource leaks, CLI args for output jar