Simple version of IPython's rmagic, suitable for use outside IPython (rmagic2 wrapper)