Added lib/misc.js with clamp(), added build tests.
Rearranged lib_base64_test.js build tests.