Fixed completion of magics in ipython shell.
Some small fixes. (Go to history, printing of KeyboardInterrupt. Cleanup of go_to_substring.)