Merging in #46 with some slight tweaks.  Moved the replacement method to Ghprb as a static function.