Refactor bits of {add,remove}_metric and small cleanups
Refactor bits of {add,remove}_metric and small cleanups

We can move the check to see if the event specified is valid outside
the function and reduce the repeated code.  Also remove a loop that
we no longer need.

aeg-aeg/pcpfans,mbaldessari/pcp,adfernandes/pcp,edwardt/pcp,prasincs/pcp,aeg-aeg/pcpfans,wuliming/pcp,adfernandes/pcp,aeg-aeg/pcpfans,adfernandes/pcp,prasincs/pcp,mbaldessari/pcp,edwardt/pcp,andyvand/cygpcpfans,aeg-aeg/pcpfans,wuliming/pcp,adfernandes/pcp,tjanez/pcp,aeg-aeg/pcpfans,mbaldessari/pcp,wuliming/pcp,andyvand/cygpcpfans,andyvand/cygpcpfans,andyvand/cygpcpfans,andyvand/cygpcpfans,adfernandes/pcp,wuliming/pcp,prasincs/pcp,adfernandes/pcp,prasincs/pcp,tjanez/pcp,aeg-aeg/pcpfans,wuliming/pcp,andyvand/cygpcpfans,edwardt/pcp,adfernandes/pcp,tjanez/pcp,andyvand/cygpcpfans,edwardt/pcp,tjanez/pcp,aeg-aeg/pcpfans,wuliming/pcp,tjanez/pcp,prasincs/pcp,mbaldessari/pcp,adfernandes/pcp,wuliming/pcp,mbaldessari/pcp,prasincs/pcp,tjanez/pcp,prasincs/pcp,prasincs/pcp,aeg-aeg/pcpfans,edwardt/pcp,edwardt/pcp,edwardt/pcp,andyvand/cygpcpfans,mbaldessari/pcp,tjanez/pcp,edwardt/pcp,wuliming/pcp,tjanez/pcp