Use builtin json instead of simplejson.
Use platform independent chmod.
Commented-out locs is a violation, not a metric.