Py3k: core, closing open file pointers

* also fixing numpy DeprecationsWarnings
* replacing assertEquals with assertEqual