A hierarchical router for JavaScript applications