restructure package, add top-level function for processing configs