The Constrained Search Approach, Mappings to External Potentials, and Virial-Like Theorems for Electron-Density and One-Matrix Energy-Functional Theories