Refractored test_oct2py.py's test code.

Hi,

I've refractored the code in `test_oct2py.py`. The key idea is to make sure that there is no global oct2py session and all sessions are closed once they're not needed anymore.

If you're interested in merging, please review carefully - It took less time than it probably should have.