Validate Node Names

<b>Additions</b>
-  Validate node names so that they do not break Javascript. 
I'll note these two solutions handle nil arguments differently. Also, should zero-length strings be handled the same way and should we restrict empty (nil or zero-length) strings here or should that be closer to the UI? My vote would be set _name to empty if passed that, and validate empty at the UI.