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.
Not a big fan of the name of this function. I would prefer just `has_open_changes`. Though this requires you rename one of your variables