Fixed variables substitution errors and cleaned up and polished

Fixed the variable substitution errors in Config, cleaned up Config, and
added better documentation