Gloucester Rugby beat Northampton 31-7 at Franklin's Gardens in Round 18 of the Gallagher Premiership.