CB-6329 added Q logic to work with callbacks

-Added, proper indent (4 spaces).
-Removed, trailing whitespace
-Fixed, callbacks double assignation.
- \r replaced by \n.

Also, now it uses Q to work with callbacks, this time is going to return
every value retrieve from the environment, all promises it will be
called, those promises are callbacks data, Q.allSettled is going to call
all of them, and then wait until every single one of them is fulfilled
or rejected, then is going to print the data and save into a file.
Adding this logic, it returns promises, and cleans the code of heavy
nesting of callbacks.