Improve numpy array filtering

- only allocate an index buffer instead of a full ndarray
- works for assignment too
- now pass the periodic_dist test case
Merge pull request #188 from serge-sans-paille/filter-write

Improve numpy array filtering