Update issue 7641

Adjust bot.ErrorCode values for alerts to be consistent with the spec.
Stop using deprecated code in the SafariDriver
Fix a handful of js errors