Introduced function-specific directory switching, cleanup routines for config bundle chooser, and a few syntax bugfixes