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
fix restoration of student answers in input boxes

The HTML for the question was being created twice.
do restoration of answers properly

I forgot about the problem with MCQ part choice order!

Now it goes like this:
- parts created; student answers loaded from resume data
- question HTML created
- part displays restore student's answers to inputs