[stex mode] Sanitize comment parsing
[stex mode] Set to two-space indentation
[stex mode] Reset tokenizer after blank line

This prevents a stray $ from setting the whole rest of
the document to math mode.

Closes #2928
[loadmode addon] Work with requirejs

See http://discuss.codemirror.net/t/loadmode-js
[sparql mode] Update with more details from 1.1

- more style classes: operator, builtin, meta, brackets
- literal metas (@ and ^^)
- many more operators
- mime type and extension from spec
[sparql mode] Property paths
Mark version 4.8.0
Bump version number post-4.8
[search addon] Do a string search if a bad regexp is entered
[search addon] Simplify control flow
Pass a context (the editor) to keymaps with a call method

Issue #2915
[shell mode] Add folding helper reference
[dialog addon] Ensure that enter presses can be preventDefault-ed

When closeOnEnter is disabled the enter event never gets default
prevented this causes issues for IE9/10, this way implementors can
optionally preventDefault if they want
Fix cursor motion in bidi text and implement direction

Each cursor/selection position now has a bias associated with it that
determines whether it is associated with the character before or after
it. This allows proper displaying of the cursor around line breaks,
and improved handling of bidi text.

The bidi algorithm is extended to take line wrapping into account, and
several related pieces of the core are updated to handle the changed
format.

The editor base direction can now be configured, and each line can
have its own direction (ltr or rtl).
Tweak and clean up the direction and bidi changes

Rename some things, reorganize code, fix mistakes, simplify some code.

It is not unlikely that I introduced new bugs in this work, but I also
fixed a bunch.

The per-editor direction option is now called simply 'direction' and
updating it at run-time works. The bias property on positions was
renamed to 'sticky', and given a string, rather than a boolean, as
value.
[bidi demo] Update to actually show off current capabilities
Try to make horizontal motion properly move across lines in rtl mode