Removed arguments from Tiddler.update()

The arguments includeInternal and includeMacros were supposed to allow
the caller to select which links should be included. In practice, none
of the callers pass any arguments, so the defaults are always used.

There was a bug in handling wiki-style links inside <<choice>> macros:
the "m" match object was used, which was set in an earlier loop,
instead of the "item" match object that contains the <<choice>> match.
This didn't lead to any visible problems because the regular link
finder would also find all wiki-style links inside macros.

Since it would require extra effort to ensure that when includeInternal
is False the update() method wouldn't pick up wiki-style links inside
macros, I decided it was better to instead drop the includeInternal and
includeMacros arguments.

I did an additional cleanup in parsing the old style <<choice>>
argument syntax: it would strip off text before the pipe character,
but that is relevant only in wiki syntax.
Support HTML import of SugarCube-based stories

SugarCube uses ID "store-area" instead of "storyArea" for the <div>
that contains all the passages.
Further simplification of Tiddler.update()

Don't bother to assign the expression iterated through to a variable
when it is only used by the following "for" statement.

Add to the "actions" list using extend() instead of list concatenation.
This avoids creation of a new list object.
Collect links in a set in Tiddler.update()

Previously, the links were collected in several lists, then combined,
converted to a set (to remove duplicates) and then converted back to
a list. That involved a lot of unnecessary work.
Also deduplicate image references in Tiddler.update()

The links were deduplicated, but the images were not. I don't see any
reason for this difference.
Use sets for storing *_PASSAGES and *_TAGS categories

Since the most common operation on these is a membership test and the
order doesn't matter, a set is a good choice for the data type.

Also use INFO_TAGS in isStoryText() instead of calling several methods
to check for specific tags.

In StoryFrame.buildIncludes(), when including files with the ".tws"
extension, passages with a title that is a *substring* of an excluded
passage name were skipped. I assume this was a bug and the correct
behavior is to skip only passages where the title is *equal* to an
excluded passage name, as was done for included Twee files (albeit
in a slightly overcomplex way).
Optimized the concatenation of story HTML 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, put the fragments in a list and at the
end join that list.

Avoid repeated lookup of the tiddler in the dictionary.

Test whether obfuscation is enabled before testing the title: this
avoids the title check completely when not using obfuscation.

The latter two optimizations probably won't have a noticable impact
on performance; the first one probably will on stories with many
passages.
Removed "html" argument from addTweeFromFilename()

There is no reason to share code between addHtmlFromFilename() and
addTweeFromFilename() since both are essentially one-liners.
Removed unused method TiddlyWiki.tryGetting()
Ignore text before first passage declaration in Twee source

Example:
===
Some Twee sources...
...have text before first declaration.
:: Start
Once upon a time...
===

Before this commit, a passage titled "Some Twee sources..." would be
created from this example. After this commit, the text before the
first passage is ignored.
Merge pull request #110 from mthuurne/tiddler_update_simplify

Tiddler.update() simplification
Merge pull request #112 from mthuurne/various_cleanup_optimize

Various optimisations
Merge pull request #111 from mthuurne/sugarcube_html_import

Support HTML import of SugarCube-based stories
Smarter scaling of images for display on Story overview

The existing code only scales based on width, resulting in tall
images being cut off. This patch scales on width or height,
whichever will allow the entire image to be displayed.

So that non-square images are displayed nicely, they are centred
after scaling.
Merge pull request #116 from lachlancooper/imagescaling

Smarter scaling of images for display in Story Map
Merge remote-tracking branch 'upstream/master'