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
update qtconsole with user_expressions changes

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

avoids ordering issues
%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.
Merge pull request #3319 from minrk/user-expressions

IPEP 13: user-expressions and user-variables

The user-expressions and user-variables side effects in execute_requests are updated to use the rich-repr display data identical to a display_data message.

closes #2654