[WIP] Cleanup memory handling related code

Open the way for improvements in memory handling.

What's been done so far:
 - s/vim_memset/memset/