Moved JS framework code into Rules.js.