A simple javascript pattern matching library