Removed dependency from Twee on wxWidgets

Twee is a command line tool, so it shouldn't depend on a GUI toolkit.
However, the "tweelexer" module contained both GUI functionality and
essential non-GUI definitions. Solved this by splitting off the regex
definitions into the new module "tweeregex" and make Twee import that
instead.
Merge pull request #127 from mthuurne/twee_no_wx

TweeRegex module
twee: Removed HTML merge feature

The feature is not useful for story authors.
Read this forum thread for some background:
  http://twinery.org/forum/index.php/topic,1463.0.html
StorySettings dialog scrollbars

* Added support for scrollbars in the StorySettings dialog, in case
custom story formats wish to add a lot of settings that necessitate a
longer window.
* Removed the "IE hack" from monospacedByLineHelper, after confirming
that it is not needed in IE 8.
twee: Fix preservation of passage order

This feature was introduced in 4a038af9, but I broke it in bba0e147
when I did the tabs to spaces conversion on the wrong version of the
"twee" script (the part in tiddlywiki.py survived).
Fixed StoryIncludes on OS X

buildIncludes() wasn't taking the story's path into account for relative filenames.
Merge pull request #129 from mthuurne/twee_remove_merge

twee: Removed HTML merge feature
Merge pull request #130 from mthuurne/fix_passage_order

Fix preservation of passage order in Twee
Monitor clipboard on a timer

This fixes a crash on exit when using wxPython with the GTK backend.
The Clipboard.IsSupported() method seems to cause the event loop to be
re-entered, but if the frame destroy event is handled by that inner
event loop call, a segfault happens. Since the native part of a timer
is removed when the Python proxy reaches 0 references, this problem
does not occur when the clipboard is accessed from a timer.

Note that when the clipboard cannot be opened, the new code will keep
the paste menu entry in unchanged, while the old code would disable
it. I expect the clipboard failing to open to be a temporary condition
in most cases, so then the new behavior makes more sense.
Improved paste implementation in StoryPanel

The old code would forget to close the clipboard if contained data in
an unsupported format. Also it ignored the return value of GetData().

Also renamed the "format" variable since format() is a built-in
function: while it is rarely used, it does receive syntax highlighting
in my editor like any other built-in name, which is distracting.
Only open clipboard for copying image if there is an image

The old code would open before checking whether the image exists.
Since the check is much cheaper than opening the clipboard, it is
more efficient to check first. Also, the old code would forget to
close the clipboard if the image didn't exist.
Merge pull request #131 from mthuurne/clipboard

Clipboard improvements
"Prompt before exiting" StorySetting

* Added an optional 'exitprompt' StorySetting which, when set, shows a
prompt when the player closes or reloads the story's page in the
browser. This uses window.onbeforeunload, and isn't guaranteed to be
supported in every browser.
* Wikifier.parse: input strings containing variable-like syntax no
longer cause the variable to be defaulted.
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.