Call config function as appropriate
Initial revision
Many updates and rewriting to clean up the code
Change return values
Many changes and updates for large-scale rewrite and making it more straightforward