Singular Structures and Generic Regularity of Minimal Surfaces and Mean Curvature Flow