refactor
fixed backtracking
implemented router.match and derivatives