Merge pull request #964 from evoskuil/master

Incorporate libsodium option and linkage, generalize, update packaging.