Moved stuff to headers.

Lots of changes of the sort.