Galaxy and mass assembly: luminosity and stellar mass functions in GAMA groups