Add 'on_demand' option to interact() so that long-running functions can be started only when explicitly requested
Disable run button until the function finishes
Add tests for the on_demand option
Update custom.js

Explain different semantics required for instances versus functions or classes. Based on comments of @minrk in #5985.
Implement atomic save

Ping @fperez, this should avoid issues with corrupted/lost notebooks
when the disk is full, though I haven't worked out how to test it just
yet.

Closes gh-6254
Rework atomic_writing with tests & docstring
Update custom.js
Add fsync() call in atomic_writing
Load rpy2.ipython for rmagic, print deprecation warning
Remove rmagic tests
Remove rmagic docs

Leaving intersphinx link to rpy2 docs.
No need to check for rpy2 in test machinery
Docs fixes for rmagic deprecation
Add URL to warning about rpy2
close websocket connections on ping/pong timeout

we recently added ws pings for keep alive,
and we can now use the longs to close dead connections.

This can apparently happen when connections are not closed cleanly,
e.g. on VPNs.

Setting ws_ping_timeout = 0 disables the ping mechanism altogether.
Minor improvements to file upload.

Updated file upload so that the icon of the new upload item reflects if it is a file or notebook, added the ability to use the "Enter" key in the filename text box to cause the upload to happen, and make it so that the list of files refreshes immediately upon successful upload.
Added ESC keep to upload textbox to cancel.
Uploading a file with a name that already exists asks the user if they want to overwrite.

This is not perfect (it doesn't check against the real filesystem but the current list in the browser which may be stale) but it is better than nothing.
Fixed many edge cases in file uploads.

When there is an error reading a file, a message is shown (I could reproduce this easily by dragging a folder onto the list), added a missing "return false;" after an illegal notebook was detected, and we prevent no-name files and files starting with dots (which will not be visible in dashboard and automatically overwritten).
File list refreshes no longer move the upload filename boxes.

The new file list is always placed after the upload filename boxes. I also removed the autorefresh guards against refreshing while having an upload box since this is no longer a problem.