Note vestigial RPC codes
Refactor sdiag code

Minor restructuring of code in sdiag. No real change in logic.