move safe_unicode to py3compat
user_variables and user_expressions use rich repr API

each key will be a rich display_data message rather than plaintext reprs.
test user_variables/expressions in message spec
add user-expressions/variables changes to message spec
decode subprocess output in launchers

closes #3326
Fix IPython.utils.path when HOME=/.
Fix subrepos.
Pop out any existing IPYTHONDIR or IPYTHON_DIR variables.
update qtconsole with user_expressions changes

lsmagic now uses JSON, rather than ast eval
use sets when testing user expressions

avoids ordering issues
skip submodule check in package managers

custom DEFAULT_STATIC_FILES_PATH means a package is responsible, and everything should be assumed to be fine.
check static path components
s/os.path.split/os.path.dirname/
%lsmagic returns a RichRepr of the magics dict

- pretty / str representation are the regular lsmagic output
- JSON repr is just the magics dict with instances replaced with their class names in order to be jsonable.

qt magics menu population updated to reflect this.
add missing ClusterApp mixin to SSHClusterLauncher

fixes AttributeError on profile_dir in SSHProxyEngineSetLauncher

also adds SSHProxyEngineSetLauncher to ssh launcher collection,
which adds it to the generated config files, help output, etc.
basic launcher tests

doesn't do much at the moment,
but at least makes basic exercise of constructing objects
workaround spurious CodeMirror scrollbars

always draw scrollbar margin, so that inappropriate scrollbars never overlap the last line.
To compensate for the extra space, the margin between the scrollbar and the last line is shrunk significantly.
move anchor-link off of heading text

avoids confusion about where to click, matching Sphinx-style output.

Moves the relevant style to textcell.less
Failing test for gh-3246
Use new input transformation API in %paste

Closes gh-3246