Updated exec_cmd to allow for distinguishing foreground and background execution (not actually executing in background yet)