migrated diag server code to common; only minimal skeleton left in the samples