[INTERNAL] moved FeatureMap code to C file incl additional fixes

 * moved code associated to templatized FeatureMap to the respective C files
 * replaced obsolete includes with forward declarations