forEach and indexOf replacements for common.js