Factoring and learning algorithms for low-depth algebraic circuits