part way through JSlinting the source
JSLinted the rest