Clean up of memory.c and friends

Apparently there's a lot to do. Especially when trying to conform to the developer guidelines. ;-)

I mostly cleaned up `memory.c` and `memory.h` and all those files that called `lalloc*()` and provided a second argument to that function that was never used.