Modal: use $.extend to build settings

1. Build up the modal dialog settings with `$.extend`.
2. Fix the session timeout "timed out" message behaviour.
3. Fix double spacing issues.