Taking code from Config 1.0 and restructure, added tests