Bug 11404: koha-functions.sh introduced for reuse

As asked by Robin, a bash lib of functions is introduced with the common
functions to be reused. Most of the scripts are modified (reduced) to include
this file and the repeated functions cleaned.

No noticeable change in behaviour should be noticed.

As I've been said in #debian-mentors, it is used that files for inclusion
should be installed at the apps directory (i.e. /usr/share/koha/) so this
patch makes the install script put the file in the bin/ directory.

All koha-* scripts assume the file is there already (and fail otherwise).

regards
To+

Sponsored-by: Universidad Nacional de Cordoba
Bug 11404: Make the install process aware of the changes
Debugging