Remove 5s wait on inactivity on GUI inputhook loops

The 5s (and 1s) waits were originally added in commit 5074878, but the 5 second wait meant if you left the console for 5+ minutes idle, it would
take up to 5 seconds for a response to a keypress. This tradeoff of CPU
cycles for battery life seems too far.

Note that commit 5074878 was originally for wx, glut and pyglet are based
on the wx version and came into existence after commit 5074878.
don't instantiate IPython shell as class attr

in sphinxext.ipython_directive

also fix capitalization, because reasons.
Merge pull request #4412 from jdfreder/traitlet_notify_fix

Fix traitlet _notify_trait by-ref issue

This fixes a problem with the existing traitlet machinery, where anytrait values get added to the notifiers list every time the _notify_trait function is called.

The bug is that each time the traitlet changes, the anytrait callbacks will each be called N times, where N is the number of times the traitlet has been changed (in the current application instance).
Merge pull request #4400 from jonahkichwacoders/remove_5s_wait

Remove 5s wait on inactivity on GUI inputhook loops

1s should be enough
Specify unicode type properly in rmagic
Merge pull request #4413 from minrk/sphinxext

don't instantiate IPython shell as class attr
Merge pull request #4414 from takluyver/rmagic-unicode-type

Specify unicode type properly in rmagic
Improvements to kernel.js

- dispatch iopub handlers by msg_type
- add Kernel.send_shell_message public API
- use strict (and related fixes)
add Kernel-side widgets
add javascript-side widgets
document widget messages
fix js/Python WidgetManager symmetry

remove some log statements
make js / Python widgets symmetrical

don't enforce creation on Kernel side

also removed weak refs - premature optimization,
we can think about this later.
update widget message spec doc to reflect symmetry
fix Widget.primary
rename widget to comm
s/destroy/close
pass whole message to Comm handlers
COMM: mirror Python callback API in Javascript
zmqshell has handle on Kernel