Code Refactor

Accidently re-included this code on merge. It has been extracted to file
datepickerload.js.