Added tests, modified Router so that it's more compatible with PHP <= 5.3