Substantial changes to neighbor structure, added support for sparse elements.