[WIP] Neighborhood

Extensive changes to the neighborhood arrfunc, and also some cleaning up of dynamic parameters.