kml_export: use more utility functions as suggested by @wpferguson
Scripts in this folder are meant to have an "owner" who maintains them.