add MIRI LRS grating; misc code cleanup
added Preferences dialog, menu enhancements, bug fixes