Tests and minor adjustments for lib/route.js