The Adaptive Toroidal Equilibrium (ATEQ) code and its applications