Make routing logic configurable
Cleanup code
Merge pull request #19 from cowboy129/master

Make routing logic configurable