Moved route matching into a separate method named parseToken.

I moved the parsing of routes out of the parse method so that one can parse/match token without dispatching them. 

All the tests pass but I think the behaviour is changed slightly in that the first matching route is always returned whereas the previous version would continue looking at routes if the dispatch failed.

I have kept the return values for the parse method.