Bug 754032: localize preferences

This feature has already been implemented. 
Here I just added necessary modification in order to support this in cfx-js.

Before doing this I merged with current master.
The only modification really made is last revision ea482be.
Otherwise, that is the only modification made into cfx-py that needs to be backported into JS.

Feel free to request me to do two pull request, one for the preferences and one for the merge.
There might be better way to merge with master? Wouldn't it be better with --no-ff?