[yaml2obj] Move some classes into anonymous namespaces.