Optimized the concatenation of Twee story fragments

The main thing is to avoid adding to a string repeatedly, since this
requires an increasing number of bytes to be copied again and again
as the string grows. Instead, pass a generator to join().
Commit 3914ac50 does something similar for HTML fragments.

Added "order" argument to docstring.

Changed the "not order" check to "order is None": if the user passes
an empty sequence for "order", the correct output is the empty string.
Add "untwee" command line tool

This is similar to the old Twee "untwee" tool: it reads a story
in HTML format and outputs in Twee format.

The code is derived from the "twee" script though rather than from
the original "untwee" script.
untwee: Order passages in output

Split the story passages from the info passages and put the story
passages at the end.

Within those two categories nothing clever is done yet, so for now
I just sort the passages by name alphabetically; that's at least
more helpful to human readers than using Python's hash order.
untwee: Try to put info passages in a meaningful order

The special passages are in the order that SugarCane/Cube display them
in the side bar. Annotations were put last since they could be related
to either the info passages or the story passages, so having them on
the boundary between info passages and story passages made sense.
untwee: Added passage reorder command line option

This controls whether the output passage order is equal to the HTML
order (order preserved) or whether untwee should compute a passage
order (reorder).

The default is to autodetect whether the passage order in the HTML
is likely to be meaningful. Currently this happens by determining
which compiler created the HTML: iff the compiler preserves the
input passage order, untwee will preserve the order as well.
Fixed <style> elements in passages

Previously, <style> and <script> elements' contents would be converted
to charspans. This should no longer be the case.
Put code to determine default passage text in a method by itself

This avoids duplication and simplifies the createInfoPassage() method.
Make StorySettingsFrame and ImageFrame inherit directly from wx.Frame

Previously, they inherited from PassageFrame, but they didn't call the
constructor of PassageFrame and don't seem to be using any of its
methods either.
Remove latest test build in window close handler instead of destructor

It is hard to predict when destructors run, or even if they run at all:
the documentation states "It is not guaranteed that __del__() methods
are called for objects that still exist when the interpreter exits."
  http://docs.python.org/2/reference/datamodel.html
So it is more reliable to do cleanup actions on window close.

Note that the original code failed to call the superclass destructor.
Fix missing import in Replace Across Story
Fixed a few unterminated RTF control words

In an RTF control word that ends with a digit, a following space is
considered part of the control word. So to make sure spaces in the
following text are not swallowed by the control word, a space should
be output after the digit.

Reported in point 3 of this post:
  http://twinery.org/forum/index.php/topic,1503.0.html
Merge pull request #133 from mthuurne/various_cleanup

Various cleanups
Merge pull request #132 from mthuurne/untwee

Untwee