Add tests for things in utils
Use print_function
Merge pull request #5261 from jdfreder/more-dual-mode

Don't allow edit mode up arrow to continue past index == 0
Start of new callback system
Add mock to requirements for testing
Add docstrings for callbacks
Cross link signatures docstrings
Add tests for callback infrastructure
Deprecate some hooks in favour of callbacks
Use callbacks system for autoreload
Document new callbacks system
Rename callbacks -> events (mostly), fire -> trigger
Add note about experimental API
Rename pre/post_execute_explicit events to pre/post_run_cell
Rename shell_initialised for orthographically challenged English speakers
Clarity fixes pointed out by @ellisonbg
log refusal to serve hidden files dirs
Update docstrings to refer to ip.events
Use silly American spelling for initialised
callbacks -> events in docs