create a detach helper and use detach helper in replace of nextTick

In response to #748

Created a new helper to pick setImmediate when available and process.nextTick when not.
And I then replaced code that relied directly on process.nextTick

Review @mikeal @emkay @nylen @FredKSchott