javascript: move parse_rules, stringify_rules
proof-of-concept: generate scenario server-side