Use internal functions where possible
Use internal functions where possible

This uses the WithMemProfile and WithCpuProfile internally as opposed to using `if` statements with the same checks.

yapdns/yapdnsbeat,yapdns/yapdnsbeat