Pseudoeigenvalue methods for orbital optimization. General theory and application to closed shell, open shell, and two configuration SCF wave functions