Document and test custom key distribution function

Solves issue #299
Merge branch 'hotfix/document_array_distributor'