glue: error handling requires better context setup

Also imported a metric tonne of tests from Jacob's pull request and ran
against node 0.8.20. The tests are mostly passing, with the exception of
a discrepancy in core-asynclistener.simple.js, which is off by two.