If you set the accessor function, it will give the desired results. Here is a FIDDLE with value renamed to amount.
Pertinent sections of code:
...
{"name": "Great Powers", "amount": 3938, ...}, // changed from "value" to "amount"
...
var treemap = d3.layout.treemap()
.value(function(d) {return d.amount}) // IMPORTANT
...
.sort(function(a, b) { console.log(a.amount); return a.amount - b.amount; })
...
function accumulate(d) {
return (d._children = d.children)
? d.amount = d.children.reduce(function(p, v) { return p + accumulate(v); }, 0)
: d.amount;
}