Added basic support for magic commands, a la ipython.