Export function results through stdout instead of global variables

@charlierudolph @daviscabral This change minimizes the use of global variables by making functions export their result though stdout rather than global variables.
I would like this to be named `initial_branch_name`. The current branch typically changes when a script runs.