refactor github parser

I updated the get commits method to use map instead of each so that we
didn't need to instantiate an empty array every time we checked for
commits. I also added a method to get the latest commit data to separate
the concerns.