Improved performance of getInteger helper function.

I had anoter look at the implementation and did some measurements. This is what i have come up with so far.

Performance: http://jsperf.com/match-numbers