Cleanup code generation as per rdebath's suggestions.
Cleanup, update README.