Remove usage of deprecated 'function' keyword.

See http://wiki.bash-hackers.org/scripting/obsolete for more information on
the deprecation of 'function'.  This change enables scripts to be run on
Ubuntu systems.