node 0.6 compatibility fixes.
Test hooks and compatibility fixes for node 0.9.