time(it) magic: format timespans up to hours in human readable form

* Refactor time formatting of timeit into a new function
* Add minutes and hours for long running cells/lines
* Convert time and timeit magic to use the new function

Minutes and hours are float formatted, so 1.5 h is "1 hour, 30 minutes".

Signed-off-by: Jan Schulz <jasc@gmx.net>
time magic: make it usable as cell magic

Convert time to be usable as cell level magic. Also fix some examples,
which didn't have a '%' in front of the magic.

Signed-off-by: Jan Schulz <jasc@gmx.net>
Print a real "µs" instead of "us"

The unicode version is guarded so that it won't crash in terminals which
do not support that sign.

Signed-off-by: Jan Schulz <jasc@gmx.net>
time(it) magic: More human readable time format for value >1min

Signed-off-by: Jan Schulz <jasc@gmx.net>
time magic: fix unittests

time is now reported as '0 ns' and not '0.00 s'

Signed-off-by: Jan Schulz <jasc@gmx.net>
Test if sys.stdout has an encoding attribute

Signed-off-by: Jan Schulz <jasc@gmx.net>
time(it) magic: reorganize time formatting code

Signed-off-by: Jan Schulz <jasc@gmx.net>
Remove dead code in utils.data
Remove utils.autoattr
Consolidate utils.pyfile into utils.openpy
Remove utils.io.nlprint
Inline trivial file_read() function
Remove unused raw_input_ext and raw_input_multi functions
Remove unused *grep functions
Remove more unused functions from utils.text
Remove unused utils.notification
Remove unused utils.growl
Remove unused utils.newserialized
Don't call ast.fix_missing_locations unless the AST could have been modified.

Should close gh-2879
Merge pull request #2855 from JanSchulz/2751_timit

time(it) magic: Implement minutes/hour formatting and "%%time" cell magic