Should unshift() from sendQueue and not pop()

Motivation:
Currently we are using an array as a queue. We push tasks that are to be
sent to the server when offline. When we are online we go through and
send each one in the order added. The problem is that we are using pop
which removes and element from the end of the array. We want to remove
from the from and should use the shift().