Saving future compile directives from ipython -i

Here's a version that copies a lot of code, just so there's something to discuss. Ideas on the right way to go about this?

* There's lots of repeated code because I didn't want to mess with the signature of py3compat.execfile.
* Not working for python -i module.ipy yet
* Is this too much functionality for py3compat?
* No new tests yet
I think this one should be skipped on Python 3.