work on generate prims and system functions

A fair bit of work on lisp_system.c and some work on generate prims, I
was working on some compile issues with prim.c. But I haven't fixed them
all, but I want to at least commit something.