lib: improved forEach object performance

Trying to squeeze-out more performance out of the **object loops**. 

Based on [this perf test](http://jsperf.com/object-keys-foreach-vs-for-in-hasownproperty) I wrote 2 weeks ago. 

It shows that the implemented code in this pull request is faster in most javascript engines than the previous implementation. Which is also true for google chromes V8.

Cheers