Squashed 'klib/' content from commit 28c6d83

git-subtree-dir: klib
git-subtree-split: 28c6d8307950929510a1cbb57ed023eff70b1050
Merge commit '713c3b0d564a7803933a824a2b7796e421787bd8' as 'klib'
doing a balance between kvecs and standard multi dim types for clarity, added memory safe macros for reallocation