code: function toRouteList(routeMap) {
  	var routeList = [];
  
  	var root;
  
  	// exclude root from sorting
  	if (routeMap['/']) {
  		root = routeMap['/'];
  		root['path'] = '/';
  		routeMap['/'] = null; //todo: map remove method?
  	}
  
  	var paths = Object.keys(routeMap);
  
  	for (var i = 0, len = paths.length; i < len; i++) {
  		var path = paths[i];
  		if (path == '/') {
  			continue;
  		}
  		var route = routeMap[path];
  		route['path'] = path;
  		routeList.push(route);
  	}
  
  	routeList.sort(function(a, b) {
  		if (a['group'] < b['group']) {
  			return -1;
  		}
  		if (a['group'] > b['group']) {
  			return 1;
  		}
  		if (a['path'] < b['path']) {
  			return -1;
  		}
  		if (a['path'] > b['path']) {
  			return 1;
  		}
  		return 0;
  	});
  
  	// put root at the top
  	if (root) {
  		routeList.unshift(root);
  	}
  
  	return routeList;
  }
docs: Transforms route map into a list of routes sorted by group/path. Route 'path' will be injected into each route.