mainly fixing compilation problems
still problems with inline functions
remove all inline functions which don't have their scope limited to the
current file