chore(js): simplifies elgg.ui.initDatePicker logic

...and some WS cleanup