Quasi-secular evolution of mildly hierarchical triple systems: analytics and applications for GW sources and hot Jupiters