Add shebang to rc files.  Minor refactoring.