JavaScript glob matcher