Question: In the Maven Standard Directory Layout where do I put Rules Engine files? Specifically, I'm using JBoss Rules (Drools), if that matters.

Answer: 
I use a simple/minimal solution, one line, cross browser, and works with legacy browsers as well:

```
/\bmyClass/.test(document.body.className) // notice the \b command for whole word 'myClass'

```

This method is great because does not require [polyfills](http://polyfill.io) and if you use them for `classList` it's much better in terms of performance. At least for me.

Update: I made a tiny polyfill that's an all round solution I use now:

```
function hasClass(element,testClass){
  if ('classList' in element) { return element.classList.contains(testClass);
} else { return new Regexp(testClass).exec(element.className); } // this is better

//} else { return el.className.indexOf(testClass) != -1; } // this is faster but requires indexOf() polyfill
  return false;
}

```

For the other class manipulation, see the complete file [here](https://github.com/thednp/minifill/blob/master/classList.js).
Use something like:

```
Array.prototype.indexOf.call(myHTMLSelector.classList, 'the-class');

```