Designing very large (JavaScript) applications