Theory and simulations of critical temperatures in CrI_3 and other 2D materials: easy-axis magnetic order and easy-plane Kosterlitz-Thouless transitions