Datepicker options

I modified the modified version of the pull request #396 so that the DatePicker make sure that beforeShow and onClose events are not clobbered.

@mleibman Could you review and merge this?

Thanks.