Split some some util functions into hoodeye_misc.js, including some js libs from hoodeye.js