Defer import of IPython.lib.inputhook
Defer import of json
Remove unused code
Defer import of optparse