Newtonian polytropes for anisotropic matter: General framework and applications