Promise constructor with debugging helper