Validate Node Names

<b>Additions</b>
-  Validate node names so that they do not break Javascript. 
I would write this as:

```
- (void)setName:(NSString *)name {
    if (![name isEqualToString:_name]) {
        if ([name length] > 0) {
            NSString *head = [name substringToIndex:1];
            NSString *tail = [name substringFromIndex:1];
            NSCharacterSet *validHeadCharacterSet = [NSCharacterSet letterCharacterSet];
            NSCharacterSet *validTailCharacterSet = [NSCharacterSet alphanumericCharacterSet];
            head = [[head componentsSeparatedByCharactersInSet:[validHeadCharacterSet invertedSet]] componentsJoinedByString:@""];
            tail = [[tail componentsSeparatedByCharactersInSet:[validTailCharacterSet invertedSet]] componentsJoinedByString:@""];
            name = [head stringByAppendingString:tail];
        }
        _name = name;
    }
}
```