Avoid using global variable that wasn't intended to be global
Add more info when JSON return is not in JSON format
Update to use twitter API v1.1