Cleanup code & add 'generate-r-file' ant-target.