Initial work

Straight port as far as headers are concerned. I made no alterations.