Code cleanup. Also added function to auto collapse a open drowdrop when it loses focus