Add better handling for returning undefined.

Instead of returning undefined which is re-assignable, appends an undef function that returns nothing / undefined to d3 and updates instances of code that return undefined with d3.undef().