fix function definitions with `g:` prefixed name and camelize all function names