Make encode a method on config
Use pointers to Config

We really don't need to pass copies of the entire object around.