Pull out metadata from post headers

Also cleans up some logging issues that have been bugging me for awhile.