useful javascript utilities and related functionality