[functions] some changes, should work with gcc again
* removed typename ... template from the ...EntityType typedefs
* leave only the typedefs in interfaces.hh and use them
  everywhere
* some cleanup/whitespace changes