Refactored GAIA to use CfgFunctions

Reworked GAIA to use CfgFunctions instead of manually compiled files with not standardized function names.