Make script output json to simplify inclusion in javascript
Don't use ruby-ism \A in regex
Add note why Regexp.union isn't allowed