rewrote in golang

Added support for global config system.