Code cleanup: sparse array handling, etc.

Fixes #302.
Deprecated per-client options.

Fixes #281.