replace c++ header stuff with more portable c header stuff Also, mod file fixes and portability changes