* Add onbeforeunload and have it call onCancel * Address PR feedback * Get integration tests passing again * Add underscores * Add ENVIRONMENT_TYPE_NOTIFICATION check * Add _beforeUnload + metricsEvent