lib/misc.js: added round-and-clamp functions for 6, 8, 12, 16, 24, 32 bit long signed and unsigned values
lib/misc.js: replaced 32-bit limited bitwise OR with Math.round() as the rounding function for 32-bit helpers