Added comments, 'use strict' and fixed errors in Ruleset and automaton.