make config reader more flexible, allow using istream such as directly parse from string