Split some methods

Hi there. 

I played with mochi and need to split some methods to make a [wrapper kernel for ipython](http://nbviewer.ipython.org/github/carreau/mochi-kernel/blob/master/Prototype%20of%20Mochi%20Kernel.ipynb) in order to have it work in IPython notebook.

Mainly needed a bit more freedom to evaluate a bloc of code not coming from a file and to redirect std/out-err
more easily. 

Thanks !