Move sink calls to worker thread and use HTTP result code

These changes are needed for Chrome and jQuery compatibility.