Make context errors bite

Something, I suspect promise machinery, was preventing unhandled
'error' events from killing the program. For that reason, the error
handler now uses setImmediate to emit the error.

Errors thrown in the ready handler were being stifled, as well, so
I've rearranged it slightly so they will trigger an error event.