Complete rewrite of grok_config

Signed-off-by: Gustavo L. de M. Chaves <gnustavo@cpan.org>