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.
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.
fix #239: don't process more realtime ticks if we won.
fix #228: don't clear messagetext-- it makes us go to the next level.

I can't figure out how to write a test for this, since tests interact
strangely with the level state machine.
fix accidental global variable
Merge pull request #251 from rmmh/master

bugfix
Merge branch 'dev'