A multi-dimensional resolution of singularities with applications to analysis