Allow the user to interact with link anchors in the qtconsole

Since the qtconsole can display hyperlinks, it would be useful
to allow interacting with them.

This adds showing a tooltip when the mouse is over a link.
The tooltip code stores the anchor in ConsoleWidget._anchor,
so when the user right-clicks to select the context menu for
"Open Link" or "Copy Link Address", it uses the text that was
displayed and not whats under the current context menu pointer
location.

Also storing the anchor allows me to check to see if we've
already displayed that anchor on a new mouseMoveEvent so the
tooltip doesn't keep getting redrawn.
Test _anchor tracking in response to mouseMoveEvent Messages

Test the _anchor updating for implementing qtconsole clickable links.
Move mouse move handling to ConsoleWidget.eventFilter

Bradly Froehle pointed out my original implementation broke selecting
text and suggested moving the link tooltip handling to eventFilter.

The current version doesn't report that it handled the mouse move
message, I think this may be better as in addition to showing
the tool tip you can still select text inside the linkable object.

(Its always been a problem to select some chunk of link text in
gnome-terminal as their link handling overrides the other mouse
selecting functionality)
Merge remote-tracking branch 'upstream/master' into clickable-links
Update ConsoleWidget anchor handling test code.

The test code wasn't updated to test the eventFilter based implementation.
Fix doctest_run_option_parser for Windows

It should fix (part of) #2477.
partial refactor, can't quite get environments working
correct environment rendering
added math typesetting example notebook
Refactored to JS standards.  Fixed Attribution.

thisStyle      --> this_style.
function foo() --> var foo = function()

StackExchange improperly attributed for Davide Cervone's
Markdown+MathJax handling.  This has been fixed.

Ref:
http://stackoverflow.com/a/11231030/122022
http://www.math.union.edu/~dpvc/transfer/mathjax/mathjax-editing.js
Remove self._anchor

Bradley Froehle recommended removing self._anchor and just
requesting the anchor text for a position as it was needed.

He also pointed out that Qt handles hiding the tooltip for
the empty string and suppressing redraw messages which
simplified the event handler code.

The only problem I found is when updating my test code the tooltip
takes a moment to disappear and caches the text value for a time
longer than a function call. So I can't verify that the tooltip is
cleared when the mouse moves off the anchor.
Fix traceback handling of SyntaxErrors without linenos.
Avoid calling getline() if lineno is None.
Merge pull request #2503 from int3/syntaxerror-tb

Fix traceback handling of SyntaxErrors without line numbers.
Merge pull request #2349 from ahmadia/mathjax_fix

ENH: added StackExchange-style MathJax filtering
Use 'UTF-8' as the `encoding` attribute in `OutStream` class.

This means that `sys.stdout.encoding` returns something useful instead
of raising an AttributeError. 'UTF-8' was chosen because our version of
write actually wants a unicode string (i.e., not `bytes`) and we want
something universal which an encode the entire range of unicode characters.
Merge pull request #2500 from bfroehle/outstream_encoding

Add `encoding` attribute to `OutStream` class.
Merge pull request #2467 from detrout/clickable-links

Qt console: Add "Open Link" & "Copy Link Address" to right click menu.
clear In[ ] prompt numbers again
Merge pull request #2519 from ivanov/clear-input-prompt-on-clear-all-output

clear In[ ] prompt numbers again