Merge "diag: Reorganize/modularize diag smd implementation"