(Real) algebraic geometry for (real) trigonometric polynomials? Has somebody developed a comprehensive theory of the algebraic structure of trigonometric polynomials in several variables? If yes, where?

Background:
By a (real) trigonometric polynomial in $d$-variables, I mean a map $\mathbb{T}^d \to \mathbb{R}$ that is given by an expression of the form
$$
 f(x) = \sum_{|k| \leq K} \hat{f}(k) \exp(2\pi\mathrm{i} k\cdot x)
$$
where $k \in \mathbb{Z}^d$ and $|k| = \sup_{j=1,\dots,d} |k_j|$. Also $\mathbb{T} = \mathbb{R}/\mathbb{Z}$.
These trigonometric polynomials have many of the properties of usual polynomials, but are NOT polynomials. So as far as I know it, one cannot apply the usual algebraic-geometry constructions.
An example of a result, I would be interested in is: Given polynomials $f_1, \dots, f_{\ell}$ how does the dimension of their zero locus
$$
 \{x \in \mathbb{T}^d:\quad f_j(x) = 0,\quad j=1,\dots,\ell\}
$$
relate to the ideal generated by these polynomials?

One approach
In the Annals paper by Bourgain and Goldstein, a hint of how to do this is given. Write
$$
 \exp(2\pi\mathrm{i} k \cdot x) = \prod_{j=1}^{d} \exp(2\pi\mathrm{i} x_j)^{k_j}.
$$
Using that $\exp(2\pi\mathrm{i} x_j) = \cos(2\pi x_j) + \mathrm{i} \sin(2\pi x_j)$, one can write a trigonometric polynomial as a honest polynomial in the $2 d$ variables $C_j = \cos(2\pi x_j)$ and $S_j = \sin(2\pi x_j)$. A computation shows that this is a honest polynomial with real coefficients.
Call this polynomial $\tilde{f}$.
These set from the previous example can then be described as the zero locus of the polynomials $\tilde{f}_j$ and the polynomials
$$
 (C_j)^2 + (S_j)^2 = 1.
$$
It seems to me that using this approach one can more or less carry over most results, but I am not very good at algebra, so I might miss subtleties. It would be nice if there was some work out of these things by somebody in the field.
 A: The Bézout theorem as you describe should work in $\mathbb{T}^2$ for the reasons you outlined (do the change of variables, add in the Pythagorean conditions and apply the regular Bézout). I am more familiar with the situation over $\mathbb{R}^2$, where, since the functions are periodic, you cannot expect finitely many solutions. 
However, the natural setup in that case is given by Khovanskii's theory of fewnomials: if you restrict the arguments of your sines and cosines to some bounded interval, you can represent your trigonometric polynomials as an instance of the more general Pfaffian functions. These functions have a natural complexity associated to them, which is degree-like, though it's actually a vector of positive integers. The larger the restriction intervals, the bigger the complexity. (Any elementary function would work here, you don't need them to be trigonometric polynomials).
Khovanskii's theorem is an explicit upper bound on the number of isolated solutions of such a system (with as many equations as variables). Unfortunately, this is only an upper-bound (the problem is conjectured to be decidable, but this is not known), and the bounds are very big, probably much too big.
Khovanksii's theorem deals with more general functions than only trigonometric polynomials, so it may be possible to improve somewhat. 
