Removes duplicates from SOURCES and formats it more patch friendly

The commit  e42e63d added some duplicates to the SOURCES and due to
all files being on one line changes to SOURCES are hardly readable.

This patch removes the duplicates and reformats SOURCES such that
the files are sorted alphabetically and there is only one file per
line for better readability of future patches.
Adds missing header functions.hh to SOURCES in CMakeLists.txt