Modify tests to work outside of IPython test suite