Move vault initialisation into generate.c, start improving documentation