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.
Function description needs to be fixed (current instead of feature) and I think this function should be renamed to `has_tracking_branch`.