Add better handling for returning undefined.

Appends an undef function that returns nothing / undefined to d3 and updates instances of code that return undefined with d3.undef() to prevent from undefined re-assign bugs.