[js] add MAX() helper macro
[js] a slightly more accurate fp comparison function