fix setting image height/width from metadata
test displaying images with shape metadata
There is a bug in pandoc < 1.12.1 where the --no-highlight option is not honored
in some situations. The IPython.nbconvert.utils.pandoc module prints a warning
if minimal version is not satisfied..
Adding checks to nbconvert.utils.pandoc module to ensure Pandoc is present
and issue warnings or raise exceptions when needed. Removed module root clutter
and limited calling subprocess functions from too many places inside the module.
Arg, forgot the most important:
Put the pandoc version test under the pandoc_available test.
This avoids raising an exception when the module is imported:
the exception is only raised on pandoc(...) function calls.

It also prints warnings if pandoc is not found at import time
and if the version does not meet the expected one.
Fix exception handler syntax for Python 3 compatibility.
Improve error messages.
pandoc version is now checked at each call to pandoc.pandoc(...). Version is tested with IPython.utils.version.version_check
add whats new for minimal-pandoc
move the pandoc_available(...) call inside get_pandoc_version(...) as it also tested for availability
nbconvert.utils.pandoc:
 - reduce code duplication
 - remove obscure parameters from pandoc_available
 - use find_cmd to locate binaries
 - group runtime cached values in a private dicitonnary (easier to manipulate)

Add pandoc unittests.
code shuffling to present the API functions first, and the innards at the end of the file
big cleanup of nbconvert.utils.pandoc module. Remove useless functions, less cached values.
fix Py3 test compatibility
set profile name from profile_dir

in case profile_dir is set directly (e.g. in the notebook)

closes #4238
better cleanup sockets in Channels

- use ioloop.close(all_fds=True)
- ensure socket is closed
- no longer need override of stop in any Channel subclass
close control socket in KernelManager.shutdown

avoids leaking FDs
use jQuery attr instead of setAttribute

when appending images.

This was an optimization with no apparent performance benefit.
try assertType instead of NotEquals, null
Fixed spacing in pandoc tests
Move pandoc tests next to pandoc module