Reduce the number of header includes by using more forward declares.

Some of the proto classes also needed inline methods moved to implementation
files.