rulesets are now proper objects with a constructor

Moved all the ruleset stuff to jme.js, with a Ruleset constructor. Flags are stored in a .flags dictionary, rules in .rules.
Much more clear than it was.

fixes #259