Refactor/rename as per comments.
Added prototypes.
Use two different codes and messages for no ID/no first batch.
Fixed the config.w32.