winemenubuilder: Move utility functions to the top of the file.