Initial code review

@evanstade Please review.  Hopefully the pull request flow will let you add comments.
optional nit: I guess this would seem slightly less fragile and easier for my brain to parse if it were:

var name = field.GetAttribute('name');
name = name.slice(name.indexOf('[') + 1, name.indexOf(']'));