regroup redundant code inside a function

There was redundant code related to the retrieving of Twitch.tv API resources.

Regrouping this code inside a single function allow the file 'node-twitchtv.js' to have 37 less lines and to be more consistent.