Cleaned up the functions file so it is a bit more easy to read.
Improved support for reading the data from a HTTP Language header