Fix/tabs in config

Also cleanup horrendous circular references in header files
move includes to the cpp files where they belong
move code out of headers into cpp files