Merge pull request #1386 from ellisonbg/jsd3

Adding Javascript output handling to the notebook.
Merge pull request #1396 from takluyver/magic_tb_fix

In order for the %tb magic to work as expected, no other error can be raised by invoking it. Even if an error is caught immediately, it affects the 'last error' values in sys.

This cuts a try/except block out of ip.magic(). Happily, in this case there was a simpler way to do the same thing using `str.partition`
add failing test for %tb after SyntaxError
move exc_info extraction to Shell._get_exc_info

Synchronizes expectations between `showtraceback()` and `showsyntaxerror()`, and ensures that `sys.last_type`, etc. have the right value.
Merge pull request #1395 from takluyver/xunit-kf

Make Xunit count KnownFailure tests as skipped, not failures.
fix symlinked /home issue for FreeBSD

this is a one-line fix for ipython's pushd and friends on systems which
symlink /home directories to /usr/home. Here's the error I get on
FreeBSD 9.0 without this PR:

======================================================================
FAIL: Test various directory handling operations.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/nose-1.1.2-py2.7.egg/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/home/pi/code/ipython/IPython/core/tests/test_magic.py", line 280, in test_dirops
    nt.assert_equal(curpath(), startdir)
AssertionError: u'/usr/home/pi/.ipython' != u'/usr/home/pi/code/ipython'
- /usr/home/pi/.ipython
?              ^
+ /usr/home/pi/code/ipython
?              ^^^^^

    """Fail immediately, with the given message."""
>>  raise self.failureException(u"u'/usr/home/pi/.ipython' != u'/usr/home/pi/code/ipython'\n- /usr/home/pi/.ipython\n?              ^\n+ /usr/home/pi/code/ipython\n?              ^^^^^\n")

-------------------- >> begin captured stdout << ---------------------
/usr/home/pi/.ipython
/usr/home/pi/code/ipython
/usr/home/pi/.ipython
[Errno 2] No such file or directory: '/usr~/code/ipython'
/usr/home/pi/.ipython
popd -> /usr~/code/ipython

--------------------- >> end captured stdout << ----------------------

The reason for the above is this:

In [1]: pwd
Out[1]: u'/usr/home/pi'

In [2]: !pwd
/home/pi

In [3]: pushd code
/usr/home/pi/code
Out[3]: [u'/usr~']

with this commit:

In [1]: pushd
Out[1]: [u'~']
Only monkeypatch xunit when the tests are run using it.
Merge pull request #1405 from takluyver/xunit-monkeypatch-on-request

Only monkeypatch xunit when the tests are run using it.

Sidesteps weird issues seen on Ubuntu buildbots.
document how to select browser for notebook
added --browser option to notebook

now you can specify --browser=firefox when starting ipython notebook
be more explicit about how --browser value is used
Create a shell application controller using direct Win32 API
Merge pull request #1402 from ivanov/homedir-symlink-fix

fix symlinked /home issue (e.g. for FreeBSD)

fixes assumption that `~` follows no symlinks in pushd and friends.
Add javascript library and css stylesheet loading to JS class.
Minor cleanup of Javascript display code.y
Merge pull request #1377 from takluyver/i1375

Non ascii history caused problems for the %hist command with the -f option to save to file. This adds a test and fixes it using io.open.

closes #1375
get_home_dir expands symlinks, adjust test accordingly
ignore errors in shell.var_expand

If an error is raised in the formatter, leave it untransformed.  This means that var_expand("$foo") will return "$foo" if `foo` is undefined, but more importantly it will *not* raise when var_expand is used on literal code that doesn't expect to be expanded (e.g. %prun arguments).

Tests included.
Merge pull request #1406 from ivanov/browser-selection

adds new `NotebookApp.browser` configurable and corresponding `--browser` alias for specifying which browser should be launched with the notebook landing page.
Merge pull request #1385 from ivanov/magic-docs

updated and prettified magic doc strings