Update functions.php

Including support for subdirectories in config dir.