Check for existance of array instead of reassigning

Seems to be somewhat faster for null / undefined values: http://jsperf.com/exists-vs-reassignment

Also applied the same method to arrayForEach, arrayIndexOf, arrayFirst so that null / undefined inputs don't result in errors.