All servers fully migrated to functions code

All servers have now been migrated to the new functions code. All
functions are now separated in there own file allowing to make quicker
changes to all servers code and simpler management of the code. For the
developer the code is now very scalable.
Minor code tidy