Java8-style chainable comparators for Javascript