Modular approach for building client-side Javascript application