alter the way we extract callbacks from the arguments object

basically, due to the nature of the JS, if callback arguments[arguments.length-1] was indeed a function, when we were assigning it to the cb variable, we only assigned a pointer. When changing arguments[arguments.length-1] it was setting callback function equal to false as well, practically denying the possibility of having a callback.