add more functions to reduce duplicate code in script projects

On branch master
Changes to be committed:

	modified:   .gitignore
	modified:   lib/_km.lib