consolidate include files into one dir, improved building wrt threads/compiler flags, etc. ok landry@, sebastiap@