Calendar rebase (3) 

This replaces #1352.
I think I've said this before, but there are so many potential `refresh()` calls in here that they should be moved into `_setOptions()`. See https://github.com/jquery/jquery-ui/blob/b6bec797d6a8ef0b377a866c38c67e66a626b45f/ui/dialog.js#L646.