Safari bugfixes

This branch fixes the following bugs in Safari:
https://bugs.launchpad.net/juju-gui/+bug/1276844
https://bugs.launchpad.net/juju-gui/+bug/1276861
https://bugs.launchpad.net/juju-gui/+bug/1277148
https://bugs.launchpad.net/juju-gui/+bug/1278663
https://bugs.launchpad.net/juju-gui/+bug/1278698