Added std::string::trim
Read all the values and put them into a map.
Then read the needed values from the map. Much cleaner, more generic.