some cleanup and refactoring

also now using an inline function to grab the executable name, since we do it twice before actually setting up the stack, and need to leave the command line string undisturbed both times before setup_stack tokenizes it.
also, keep an eye on memory management!!!