Function name cannot contain -

When output.library contains a - the generated function name is not
valid.  Replace - with _ to create valid function name.
Replace ad-hoc identifier cleansing with helper function

Generalized identifier cleansing to replace invalid (and unicode)
characters with underscores to ensure a valid function name.

Applied function in other places functions were generated based on
libarary name.
Merge pull request #394 from kurtharriger/FixHotUpdateFunction

Function name cannot contain -