Fix files that do work on import instead of only if __name__ == __main__

Also, I'm not sure is `setUp` is called every time a test method is called, or only once upon instantiation of the class. We should check that to make sure that we're not accidentally re-computing things multiple times.