Refactor functionality for saving pull requests

Create some new methods and classes in order to make it easier
and more organized to get info on a bunch of pull requests and
write them to the database