refactor twitter.js to handle auth more effectively