use memoryviews instead of ndarrays
For lookups and slicing memoryviews are supposed to be more performant than ndarrays.  I haven't been able to detect any difference.  @xhochy IIRC you've looked at this in some depth; are memoryviews unambiguously better for our purposes?

Getting rid of `from numpy cimport [...]` is necessary (but not sufficient) for getting rid of numpy 1.7 deprecation warnings.