Javascript port of the Java Ant pattern matching implementation