More source cleanups, move some code StdAfx.h