Representation zeta functions of compact p-adic analytic and arithmetic groups