correct imports and add support functions for numpy 1.7.  If this fails
on 1.6, 3.2, I suggest we drop support for them