Reduce duplication in use of inputHistory.

Replaces repeated patterns for clearing and appending to the input history with single function calls. This would be worth doing for its own sake to make the code simpler, but it has the side benefit that it gives a way to "hook" pushInput for monitoring/tracing if anybody ever wants to do something like that.
Fix #226

This was an easy typo and GitHub makes this kind of change easy, so here you go.
Fix #213

Just trying to get the bug count down a bit before I do some research with PuzzleScript over the summer!
Preserve input history across rebuild in editor.
detect infinite rigid loops in the engine. makes #246 not hang browser.

The actual issue is rigid rules on the same layer (e.g. duplicates)
both matching and ORing the rigidMask representing their rigidGroupIndex
into the same rigidGroupIndexMask. Given rigid rules #0 and #1, the
resulting groupIndex that it tries to ban becomes 1|2==3.
Make synonyms of properties work.

fix #215, fix #230, fix #241, fix #243, fix #245
Merge pull request #247 from rmmh/master

Bug Fixes
Merge pull request #248 from increpare/master

pull
Fix #217: make export escape $ in replacement string
adding unit tests for
https://github.com/increpare/PuzzleScript/commit/85e70657cb619f4805016c745a30277eb0c1a0e4
https://github.com/increpare/PuzzleScript/commit/9d2c140ba7b22e5854bce4e6a70192f36c77cbbd
Merge pull request #249 from rmmh/master

Fix #217: make export escape $ in replacement string
Merge pull request #250 from increpare/master

merge fixes from master
increment version number to 1.4.1
Merge pull request #235 from JoeOsborn/patch-2

Fix #213
Merge pull request #234 from JoeOsborn/patch-1

Fix #226
Merge pull request #233 from JoeOsborn/refactor-inputhistory

Reduce duplication in use of inputHistory.
fix #207: mark play.html/standalone.html as UTF-8
fix #219: don't cancel edit mode when a message displays.
fix #221: make backup/restore keep camera stable when player disappears.
fix #211: unfocus code panel when cmd-clicking level.