Removed some code duplication and added github authentication to help with rate limits
Merge remote-tracking branch 'origin/master'