Debug module instead console.log

I have replaced console.logs with small debug module which can be turned on or off by setting environment variable.