Kmem rework

This is the accessory pull request for zfsonlinux/spl#369.