Datalist polyfill: Cleaned up display and event handling