Made foreach loops parse the initial if statement for hasOwnProperty
Currently this is in alpha stage with minimum testing, and the code is ugly.  Will clean up for patches