lib/misc.js: added get_all_variations() and array_shuffle()