reworked some of the sort.js structure via meta-functions, now more modular...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>