fix persitant offheap issues, added tests, fixed nonshared mode.
Merge remote-tracking branch 'origin/master'