Added a variant of algorithm 665, refactored into gjp_common to accentuate similarities between 665 and standard GW