Move inline functions to where they are used (some compilers didn't like the sperate header.